2022-02-15 16:20:16 +00:00
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
#MongoDB (27017)
|
|
|
|
mongodb:
|
|
|
|
image: "mongo:latest"
|
|
|
|
container_name: mongoDB
|
2022-10-31 21:39:29 +00:00
|
|
|
volumes:
|
|
|
|
- ./mongo/:/data/db
|
|
|
|
networks:
|
|
|
|
- backend
|
|
|
|
ports:
|
|
|
|
- "27017:27017"
|
|
|
|
depends_on:
|
|
|
|
- traefik
|
2022-02-15 16:20:16 +00:00
|
|
|
environment:
|
|
|
|
MONGO_INITDB_ROOT_USERNAME: root
|
|
|
|
MONGO_INITDB_ROOT_PASSWORD: rootpassword
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
#MySQL (3306) + phpMyAdmin ()
|
|
|
|
mysql:
|
|
|
|
image: "mysql"
|
|
|
|
container_name: MySQL
|
2022-10-31 21:39:29 +00:00
|
|
|
volumes:
|
|
|
|
- ./mysql/:/var/lib/mysql
|
|
|
|
networks:
|
|
|
|
- backend
|
|
|
|
ports:
|
|
|
|
- "3306:3306"
|
|
|
|
depends_on:
|
|
|
|
- traefik
|
2022-02-15 16:20:16 +00:00
|
|
|
environment:
|
|
|
|
MYSQL_ROOT_PASSWORD: rootpassword
|
|
|
|
MYSQL_DATABASE: test_db
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
phpMyAdmin:
|
|
|
|
image: "phpmyadmin/phpmyadmin:latest"
|
|
|
|
container_name: phpMyAdmin
|
2022-10-31 21:39:29 +00:00
|
|
|
networks:
|
|
|
|
- backend
|
|
|
|
depends_on:
|
|
|
|
- mysql
|
|
|
|
- traefik
|
2022-02-15 16:20:16 +00:00
|
|
|
environment:
|
|
|
|
PMA_HOST: mysql
|
2022-11-03 16:18:40 +00:00
|
|
|
labels:
|
|
|
|
## Expose phpMyAdmin Through Trefik ##
|
|
|
|
- "traefik.enable=true" # <== Enable traefik to proxy this container
|
|
|
|
- "traefik.http.routers.phpMyAdmin.rule=Host(`mysql.luke-else.co.uk`) || Host(`www.mysql.luke-else.co.uk`)"
|
|
|
|
- "traefik.http.routers.phpMyAdmin.entrypoints=http"
|
|
|
|
- "traefik.http.routers.phpMyAdmin.middlewares=redirect@file"
|
|
|
|
|
|
|
|
- "traefik.http.routers.phpMyAdmin-secured.rule=Host(`mysql.luke-else.co.uk`) || Host(`www.mysql.luke-else.co.uk`)"
|
|
|
|
- "traefik.http.routers.phpMyAdmin-secured.entrypoints=https"
|
|
|
|
- "traefik.http.routers.phpMyAdmin-secured.tls.certresolver=mytlschallenge"
|
2022-02-15 16:20:16 +00:00
|
|
|
restart: unless-stopped
|
2022-10-31 21:39:29 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
backend:
|
|
|
|
external: true
|