wordpress-dev/production/docker-compose.yml

79 lines
1.6 KiB
YAML

version: '3.7'
networks:
web:
external: true
backend:
external: false
driver: bridge
services:
redis:
image: 'bitnami/redis:5.0'
networks:
- backend
container_name: ${HOST}-redis
restart: unless-stopped
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '127.0.0.1:6379:6379'
# volumes:
# - 'redis-data:/bitnami/redis/data'
labels:
- "traefik.enable=false"
db:
image: mariadb:10.4
container_name: ${HOST}-mysql
command: --default-authentication-plugin=mysql_native_password
networks:
- backend
restart: unless-stopped
# env_file:
# - .env
volumes:
# - ./wp-db:/var/lib/mysql
- ./config/my.cnf:/etc/mysql/conf.d/zzz_my.cnf
ports:
- "127.0.0.1:3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=db
labels:
- "traefik.enable=false"
nginx:
image: nginx:1.17-alpine
depends_on:
- wordpress
container_name: ${HOST}-nginx
networks:
- backend
- web
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
- ./wordpress:/usr/share/nginx/html:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx-${HOST}.entrypoints=http"
- "traefik.http.routers.nginx-${HOST}.rule=Host(`${HOST}.${DOMAIN}`)"
- "traefik.docker.network=web"
wordpress:
depends_on:
- db
networks:
- backend
container_name: ${HOST}-wordpress
# env_file:
# - .env
build: ./
ports:
- "127.0.0.1:8081:80"
- "127.0.0.1:9000:9000"
volumes:
- ./wordpress:/var/www/wordpress
labels:
- "traefik.enable=false"