Created
March 11, 2021 23:52
-
-
Save sriperinkulam/25f43c06dbb5ffe8fe2b47424a217683 to your computer and use it in GitHub Desktop.
Wordpress Traefik fronted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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