Skip to content

Commit

Permalink
Setup docker local development enviroment
Browse files Browse the repository at this point in the history
  • Loading branch information
gnovaro committed Oct 27, 2020
1 parent df178c7 commit 2eba53b
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
indent_size = 4

[*.yml]
indent_size = 2
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM ubuntu:latest

# Update SO
RUN apt-get update && apt-get upgrade -y

# Install utils
RUN apt-get install apt-transport-https lsb-release logrotate git curl vim net-tools iputils-ping -y --no-install-recommends

# Add Ondrej's repo to the sources list
#RUN sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

# Set localtime to UTC
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime

# Update packages list
RUN apt-get update -y

# Install Apache
RUN apt-get -y install apache2

RUN a2enmod rewrite headers expires ssl http2 \
&& service apache2 restart

# Set new default virtualhost
RUN rm /etc/apache2/sites-enabled/000-default.conf
COPY deploy/apache/avideo.conf /etc/apache2/sites-enabled/avideo.conf

# Install supervisord
#RUN apt-get -y install supervisor

# Install php7.4
RUN apt-get -y -f install php7.4 php7.4-common php7.4-cli php7.4-json php7.4-mbstring php7.4-curl php7.4-mysql php7.4-bcmath php7.4-xml php7.4-gd php7.4-zip --no-install-recommends

COPY . /var/www/avideo
WORKDIR /var/www/avideo
#VOLUME [ "/storage/data" ]

# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid

EXPOSE 80
EXPOSE 443
#CMD ["supervisord"]

# By default, simply start apache.
CMD /usr/sbin/apache2ctl -D FOREGROUND
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ In order for you to be able to run AVideo Platform, there are certain tools that
- MySQL 5.0+
- Apache web server 2.x (with mod_rewrite enabled)

## Docker local development

```bash
docker-compose up --build -d
```

# Roadmap

## Version 8.9
Expand Down
17 changes: 17 additions & 0 deletions deploy/apache/avideo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<VirtualHost *:80>
ServerName avideo.localhost
DocumentRoot /var/www/avideo
Options Indexes FollowSymLinks
DirectoryIndex index.html index.php

<Directory "/var/www/avideo/">
AllowOverride All
<IfVersion < 2.4>
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>

</VirtualHost>
Empty file added deploy/nginx/avideo.conf
Empty file.
50 changes: 50 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: "3.8"

services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
container_name: avideo_db
#tty: true
#ports:
# - 3306
environment:
- MYSQL_USER=root
- MYSQL_PASSWORD=root
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=avideo
- TZ=UTC
expose:
- 3306
volumes:
- ./storage/data:/var/lib/mysql
networks:
app_net:
ipv4_address: 172.16.238.10

web:
depends_on:
- db
hostname: avideo_web
build: .
environment:
- DEBIAN_FRONTEND=noninteractive
- TZ=UTC
expose:
- 80
- 443
#volumes:
# - .:/var/www/avideo:rw
networks:
app_net:
ipv4_address: 172.16.238.20

#Docker Networks
networks:
app_net:
driver: bridge
ipam:
driver: default
config:
- subnet: "172.16.238.0/24"

2 changes: 2 additions & 0 deletions storage/data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 2eba53b

Please sign in to comment.