docker-caravane/docker-compose.yml

90 lines
1.8 KiB
YAML

version: "3.8"
services:
mysql:
image: mariadb:latest
volumes:
- db-data:/var/lib/mysql
- ./Docker/mysql/mysql.cnf:/etc/mysql/conf.d/custom.cnf:ro
- ./Docker/mysql/bashrc:/root/.bashrc:ro
- "${DB_IMPORTE_FILE}:/docker-entrypoint-initdb.d/caravane.sql"
networks:
- database
hostname: mysql
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
redis:
image: redis:4
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
networks:
- redis
ports:
- "6389"
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- 8991:80
networks:
- database
depends_on:
- mysql
environment:
PMA_HOSTS: mysql
php:
build: ./Docker/php/
expose:
- 9000
- 9001
user: ${USER_UID}:${USER_GID}
volumes:
- php-user-data:/home/${USER_UNAME}
- "${SRC_ROOT}:/var/www/html/"
- "${LOG_ROOT}/php:/var/log:rw"
- "${XDEBUG_INI}:/usr/local/etc/php/conf.d/xdebug.ini"
working_dir: "/var/www/html/"
environment:
- APP_ENV=development
networks:
- database
- redis
- server
# for xdebug
# https://github.com/docker/for-linux/issues/264#issuecomment-965465879
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- mysql
- redis
nginx:
build: ./Docker/nginx/
ports:
- 8990:80
volumes:
- "${SRC_ROOT}:/var/www/html"
- "${LOG_ROOT}:/var/log:rw"
working_dir: "/var/www/html/"
networks:
- server
depends_on:
- php
# command: [nginx-debug, '-g', 'daemon off;']
volumes:
php-user-data:
db-data:
redis-data:
networks:
database:
redis:
server: