Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wordpress Traefik fronted
version: '3.7'
services:
nginx:
image: ethibox/nginx-proxy:latest
command:
- /bin/sh
- -c
- |
sed -i -e 's/app:9000/'$$STACK_NAME'_app:9000/g' /etc/nginx/nginx.conf
nginx -g 'daemon off;'
environment:
- STACK_NAME={{ index .Service.Labels "com.docker.stack.namespace" }}
volumes:
- ${VOLUME_PATH}dmwp:/var/www/html:cached
deploy:
labels:
- traefik.port=80
- traefik.enable=true
- traefik.frontend.rule=Host:${DOMAIN:-dmwp.localhost}
networks:
- internal
- traefik
app:
image: wordpress:${VERSION:-5.3.2-fpm-alpine}
volumes:
- ${VOLUME_PATH}dmwp:/var/www/html:cached
environment:
- WORDPRESS_DB_HOST=mariadb
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=changeme
deploy:
resources:
limits:
memory: 200M
reservations:
memory: 200M
networks:
- internal
mariadb:
image: mariadb:10.3.14
volumes:
- ${VOLUME_PATH}dmwpmariadb:/var/lib/mysql:cached
environment:
- MYSQL_ROOT_PASSWORD=changeme
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=changeme
networks:
- internal
volumes:
dmwpmariadb:
dmwp:
networks:
internal:
driver: overlay
attachable: true
traefik:
external: true
name: traefik-net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment