Simplification au max de la stack.

This commit is contained in:
William 2022-07-01 16:12:33 +02:00
parent 0e7bb55369
commit 48be49ecc1
2 changed files with 32 additions and 45 deletions

View File

@ -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/*

View File

@ -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'