39 lines
1.6 KiB
YAML
39 lines
1.6 KiB
YAML
|
version: "3.8"
|
||
|
services:
|
||
|
mongodb:
|
||
|
container_name: mongodb
|
||
|
image: mongo:7.0.2
|
||
|
restart: unless-stopped
|
||
|
ports:
|
||
|
- ${APP_PORT}:27017
|
||
|
networks:
|
||
|
- tipi_main_network
|
||
|
environment:
|
||
|
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
|
||
|
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
|
||
|
labels:
|
||
|
# Main
|
||
|
traefik.enable: true
|
||
|
traefik.http.middlewares.mongodb-web-redirect.redirectscheme.scheme: https
|
||
|
traefik.http.services.mongodb.loadbalancer.server.port: 27017
|
||
|
# Web
|
||
|
traefik.http.routers.mongodb-insecure.rule: Host(`${APP_DOMAIN}`)
|
||
|
traefik.http.routers.mongodb-insecure.entrypoints: web
|
||
|
traefik.http.routers.mongodb-insecure.service: mongodb
|
||
|
traefik.http.routers.mongodb-insecure.middlewares: mongodb-web-redirect
|
||
|
# Websecure
|
||
|
traefik.http.routers.mongodb.rule: Host(`${APP_DOMAIN}`)
|
||
|
traefik.http.routers.mongodb.entrypoints: websecure
|
||
|
traefik.http.routers.mongodb.service: mongodb
|
||
|
traefik.http.routers.mongodb.tls.certresolver: myresolver
|
||
|
# Local domain
|
||
|
traefik.http.routers.mongodb-local-insecure.rule: Host(`mongodb.${LOCAL_DOMAIN}`)
|
||
|
traefik.http.routers.mongodb-local-insecure.entrypoints: web
|
||
|
traefik.http.routers.mongodb-local-insecure.service: mongodb
|
||
|
traefik.http.routers.mongodb-local-insecure.middlewares: mongodb-web-redirect
|
||
|
# Local domain secure
|
||
|
traefik.http.routers.mongodb-local.rule: Host(`mongodb.${LOCAL_DOMAIN}`)
|
||
|
traefik.http.routers.mongodb-local.entrypoints: websecure
|
||
|
traefik.http.routers.mongodb-local.service: mongodb
|
||
|
traefik.http.routers.mongodb-local.tls: true
|