Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- reverse-proxy:
- image: traefik # The official Traefik docker image
- command: --api --docker # Enables the web UI and tells Traefik to listen to docker
- ports:
- - "80:80" # The HTTP port
- - "8080:8080" # The Web UI (enabled by --api)
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker eventsdoc
- networks:
- - test_network
- - internal
- db:
- image: mysql:5.7
- volumes:
- - db_data:/tmp/dbdata
- restart: always
- environment:
- MYSQL_ROOT_PASSWORD: somewordpress
- MYSQL_DATABASE: wordpress
- MYSQL_USER: wordpress
- MYSQL_PASSWORD: wordpress
- networks:
- - test_network
- - internal
- wordpress:
- depends_on:
- - db
- image: wordpress:latest
- networks:
- - test_network
- - internal
- ports:
- - "8002:80"
- labels:
- - "traefik.backend=wordpress-example"
- - "traefik.frontend.rule=Host:localhost;PathPrefixStrip:/blog"
- - "traefik.docker.network=test_network"
- - "traefik.enable=true"
- - "traefik.port=80"
- restart: always
- environment:
- WORDPRESS_DB_HOST: db:3306
- WORDPRESS_DB_USER: wordpress
- WORDPRESS_DB_PASSWORD: wordpress
- WORDPRESS_DB_NAME: wordpress
- volumes:
- db_data: {}
- networks:
- test_network:
- external: true
- internal:
- external: false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement