From 48be49ecc1bf3b1ed91e5943332bb6af69db7d5c Mon Sep 17 00:00:00 2001 From: William Date: Fri, 1 Jul 2022 16:12:33 +0200 Subject: [PATCH] Simplification au max de la stack. --- Dockerfile | 13 ++++++---- docker-compose.yml | 64 +++++++++++++++++----------------------------- 2 files changed, 32 insertions(+), 45 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8213ab5..be4dca3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,9 @@ RUN apt-get update && apt-get install -y \ # Copy vhost config COPY vhost.conf /etc/apache2/sites-available/000-default.conf +# Enable Apache mods +RUN a2enmod rewrite + # Install PHP extensions RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd zip curl intl @@ -29,13 +32,13 @@ RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ # Get latest Composer RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer +# Clean cache +RUN apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + # Copy source code COPY . /var/www # Install php dependencies RUN composer install --quiet --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - -# Clean cache -RUN apt-get -y autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/docker-compose.yml b/docker-compose.yml index 8aa2589..7777301 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,49 +1,33 @@ version: '3' -networks: - app: - driver: bridge +#networks: +# app: +# driver: bridge services: app: build: - context: ./docker/app - args: - WWW_USER: '${WWW_USER}' - WWW_GROUP: '${WWW_GROUP}' - networks: - - app - volumes: - - '.:/var/www' - user: '${WWW_USER}' - - nginx: - build: - context: ./docker/nginx + context: . ports: - ${APP_PORT:-80}:80 - networks: - - app - volumes: - - './public:/var/www/public' +# args: +# WWW_USER: '${WWW_USER}' +# WWW_GROUP: '${WWW_GROUP}' +# networks: +# - app +# volumes: +# - '.:/var/www' +# user: '${WWW_USER}' - mailhog: - image: 'mailhog/mailhog:latest' - ports: - - '${FORWARD_MAILHOG_PORT:-1025}:1025' - - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025' - networks: - - app - - mysql: - image: 'mysql:8.0' - environment: - MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' - MYSQL_DATABASE: '${DB_DATABASE}' - MYSQL_USER: '${DB_USERNAME}' - MYSQL_PASSWORD: '${DB_PASSWORD}' - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - networks: - - app - ports: - - '${FORWARD_MYSQL_PORT:-3306}:3306' +# mysql: +# image: 'mysql:8.0' +# environment: +# MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' +# MYSQL_DATABASE: '${DB_DATABASE}' +# MYSQL_USER: '${DB_USERNAME}' +# MYSQL_PASSWORD: '${DB_PASSWORD}' +# MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' +# networks: +# - app +# ports: +# - '${FORWARD_MYSQL_PORT:-3306}:3306'