wordpress-dev/production/docker-compose.yml

84 lines
2.2 KiB
YAML
Raw Normal View History

2020-03-08 15:55:06 +00:00
version: '3.7'
networks:
web:
external: true
backend:
2020-03-08 17:21:12 +00:00
external: false
2020-03-08 15:55:06 +00:00
driver: bridge
services:
redis:
image: 'bitnami/redis:5.0'
networks:
- backend
2020-03-08 17:21:12 +00:00
container_name: ${HOST}-redis
2020-03-08 15:55:06 +00:00
restart: unless-stopped
environment:
- ALLOW_EMPTY_PASSWORD=yes
# volumes:
# - 'redis-data:/bitnami/redis/data'
labels:
- "traefik.enable=false"
db:
image: mariadb:10.4
2020-03-08 17:21:12 +00:00
container_name: ${HOST}-mysql
2020-03-08 15:55:06 +00:00
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
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
2020-03-08 15:55:06 +00:00
labels:
- "traefik.enable=false"
nginx:
image: nginx:1.17-alpine
depends_on:
- wordpress
2020-03-08 17:21:12 +00:00
container_name: ${HOST}-nginx
2020-03-08 15:55:06 +00:00
networks:
- backend
- web
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf:ro
- ./wordpress:/usr/share/nginx/html:ro
labels:
- "traefik.enable=true"
2020-03-08 17:21:12 +00:00
- "traefik.http.routers.nginx-${HOST}.entrypoints=http"
- "traefik.http.routers.nginx-${HOST}.rule=Host(`${HOST}.${DOMAIN}`)"
2020-03-09 20:14:10 +00:00
- "traefik.http.middlewares.nginx-${HOST}-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.nginx-${HOST}.middlewares=nginx-${HOST}-https-redirect"
- "traefik.http.routers.nginx-${HOST}-secure.entrypoints=https"
- "traefik.http.routers.nginx-${HOST}-secure.rule=Host(`${HOST}.${DOMAIN}`)"
- "traefik.http.routers.nginx-${HOST}-secure.tls=true"
- "traefik.http.routers.nginx-${HOST}-secure.tls.certresolver=http"
- "traefik.http.services.nginx-${HOST}.loadbalancer.server.port=80"
- "traefik.http.routers.nginx-${HOST}-secure.service=nginx-${HOST}"
2020-03-08 15:55:06 +00:00
- "traefik.docker.network=web"
wordpress:
depends_on:
- db
- redis
2020-03-08 15:55:06 +00:00
networks:
- backend
2020-03-08 17:21:12 +00:00
container_name: ${HOST}-wordpress
2020-03-08 15:55:06 +00:00
# env_file:
# - .env
build: ./
volumes:
- ./wordpress:/var/www/wordpress
labels:
- "traefik.enable=false"