diff --git a/.editorconfig b/.editorconfig index ce87ec383153..de5036f98f69 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,4 +6,7 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = space -indent_size = 4 \ No newline at end of file +indent_size = 4 + +[*.yml] +indent_size = 2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..ffac530e83c2 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index e1e9ebc83caf..4ae1def35544 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/deploy/apache/avideo.conf b/deploy/apache/avideo.conf new file mode 100644 index 000000000000..7683972dae19 --- /dev/null +++ b/deploy/apache/avideo.conf @@ -0,0 +1,17 @@ + + ServerName avideo.localhost + DocumentRoot /var/www/avideo + Options Indexes FollowSymLinks + DirectoryIndex index.html index.php + + + AllowOverride All + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/deploy/nginx/avideo.conf b/deploy/nginx/avideo.conf new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000000..d2be2662531f --- /dev/null +++ b/docker-compose.yml @@ -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" + diff --git a/storage/data/.gitignore b/storage/data/.gitignore new file mode 100644 index 000000000000..d6b7ef32c847 --- /dev/null +++ b/storage/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore