version: "3"
services:
app:
build: "./docker/app"
ports:
- "9000"
# working_dir: "/var/www/html"
volumes:
- ".:/var/www/html"
nginx:
image: nginx:alpine
restart: always
ports:
- "8000:80"
volumes:
- "./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- ".:/var/www/html"
depends_on:
- app
mariadb:
image: mariadb
restart: always
ports:
- "3306"
environment:
- MYSQL_ROOT_PASSWORD=2788
volumes:
- "mariadb-data:/var/lib/mysql"
redis:
image: redis:alpine
ports:
- "6379"
volumes:
- "redis-data:/data"
volumes:
mariadb-data:
redis-data:
FROM php:7.3-fpm-alpine
RUN apk add --no-cache $PHPIZE_DEPS git \
&& pecl install redis \
&& pecl install xdebug-beta \
&& docker-php-ext-enable redis xdebug \
&& docker-php-ext-install -j$(nproc) pdo pdo_mysql \
&& mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" \
&& curl -sL https://getcomposer.org/installer | php -- --install-dir /usr/bin --filename composer
COPY config/* $PHP_INI_DIR/conf.d/
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN adduser -D -u 1000 anton
USER anton
Контейнер = 1 единица сконфигурированного ПО. Внутри - как бы черный ящик. Все взаимодействие - снаружи.