docker-caravane/docker-compose.yml

108 lines
2.2 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
api:
build: ./Docker/api/
expose:
- 9000
- 9001
user: ${USER_UID}:${USER_GID}
volumes:
- php-user-data:/home/${USER_UNAME}
- "${API_ROOT}:/var/www/html/api"
- "${LOG_ROOT}/php:/var/log:rw"
- "${XDEBUG_INI}:/usr/local/etc/php/conf.d/xdebug.ini"
working_dir: "/var/www/html/api/src"
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
app:
build: ./Docker/app
user: ${USER_UID}:${USER_GID}
volumes:
- "${APP_ROOT}:/app"
- npm-user-data:/home/${USER_UNAME}
networks:
- app
- server
ports:
- 3000:3000
working_dir: "/app"
environment:
- APP_ENV=dev
tty: true
nginx:
build: ./Docker/nginx/
ports:
- 8990:80
volumes:
- "${API_ROOT}:/var/www/html/api"
- "${APP_ROOT}:/var/www/html/app"
- "${LOG_ROOT}:/var/log:rw"
working_dir: "/var/www/html/api/"
networks:
- server
depends_on:
- api
- app
# command: [nginx-debug, '-g', 'daemon off;']
volumes:
php-user-data:
db-data:
redis-data:
npm-user-data:
networks:
database:
redis:
server:
app: