Hangar/docker/deployment/docker-compose.yml
2021-06-30 12:53:01 -07:00

127 lines
4.4 KiB
YAML

version: '3.7'
services:
frontend:
image: "ghcr.io/papermc/hangar_frontend"
build:
context: ../..
dockerfile: docker/deployment/hangar-frontend/Dockerfile
depends_on:
- 'backend'
environment:
# keep these in sync with gh-action!
proxyHost: "http://hangar_new_backend:8080"
authHost: "http://hangar_new_auth:8000"
lazyAuthHost: "https://hangar-auth.benndorf.dev"
host: "0.0.0.0"
PUBLIC_HOST: "https://hangar.benndorf.dev"
stdin_open: true
labels:
- "traefik.enable=true"
- "traefik.http.services.hangar-new.loadbalancer.server.port=3000"
- "traefik.http.routers.hangar-new.rule=Host(`hangar-new.minidigger.me`) || Host(`hangar.benndorf.dev`)"
- "traefik.http.routers.hangar-new.entrypoints=web-secure"
- "traefik.http.routers.hangar-new.tls=true"
- "traefik.http.routers.hangar-new.tls.certresolver=default"
- "traefik.http.routers.hangar-new.tls.domains[0].main=minidigger.me"
- "traefik.http.routers.hangar-new.tls.domains[0].sans=*.minidigger.me"
networks:
- web
backend:
image: "ghcr.io/papermc/hangar_backend"
build:
context: ../..
dockerfile: docker/deployment/hangar-backend/Dockerfile
environment:
SSO_SECRET: "${SSO_SECRET}"
API_KEY: "${API_KEY}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
depends_on:
- 'db'
- 'auth'
- 'mail'
stdin_open: true
labels:
- "traefik.enable=false"
volumes:
- hangar_data:/hangar/uploads
networks:
- web
db:
image: "ghcr.io/papermc/hangar_db"
build: ./db
environment:
POSTGRES_MULTIPLE_DATABASES: hangarauth
POSTGRES_DB: hangar
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
ports:
- "3456:5432" # pls dont abuse open port :/
volumes:
- db_data:/var/lib/postgresql/data
networks:
- web
labels:
- "traefik.enable=false"
mail:
image: mailhog/mailhog:latest
labels:
- "traefik.enable=true"
- "traefik.http.services.hangar-new-mail.loadbalancer.server.port=8025"
- "traefik.http.routers.hangar-new-mail.middlewares=basicauth@file"
- "traefik.http.routers.hangar-new-mail.rule=Host(`hangar-new-mail.minidigger.me`) || Host(`hangar-mail.benndorf.dev`)"
- "traefik.http.routers.hangar-new-mail.entrypoints=web-secure"
- "traefik.http.routers.hangar-new-mail.tls=true"
- "traefik.http.routers.hangar-new-mail.tls.certresolver=default"
- "traefik.http.routers.hangar-new-mail.tls.domains[0].main=minidigger.me"
- "traefik.http.routers.hangar-new-mail.tls.domains[0].sans=*.minidigger.me"
networks:
- web
auth:
image: registry.gitlab.com/minidigger/hangarauth
depends_on:
- 'db'
labels:
- "traefik.enable=true"
- "traefik.http.services.hangar-new-auth.loadbalancer.server.port=8000"
- "traefik.http.routers.hangar-new-auth.rule=Host(`hangar-new-auth.minidigger.me`) || Host(`hangar-auth.benndorf.dev`)"
- "traefik.http.routers.hangar-new-auth.entrypoints=web-secure"
- "traefik.http.routers.hangar-new-auth.tls=true"
- "traefik.http.routers.hangar-new-auth.tls.options=default"
- "traefik.http.routers.hangar-new-auth.tls.certresolver=default"
- "traefik.http.routers.hangar-new-auth.tls.domains[0].main=minidigger.me"
- "traefik.http.routers.hangar-new-auth.tls.domains[0].sans=*.minidigger.me"
environment:
SECRET_KEY: "${SECRET_KEY}"
EMAIL_HOST: "mail"
EMAIL_PORT: "1025"
EMAIL_SSL: "false"
EMAIL_TLS: "false"
EMAIL_HOST_USER: "${EMAIL_HOST_USER}"
EMAIL_HOST_PASSWORD: "${EMAIL_HOST_PASSWORD}"
HANGAR_HOST: "https://hangar.benndorf.dev"
DB_NAME: "hangarauth"
DB_USER: "${POSTGRES_USER}"
DB_PASSWORD: "${POSTGRES_PASSWORD}"
DB_HOST: "hangar_new_db"
REDIS_HOST: "hangar_new_redis"
SSO_ENDPOINT_ore: "{ 'sync_sso_endpoint': ('http://hangar_new_backend:9000/api/sync_sso'), 'sso_secret': '${SSO_SECRET}', 'api_key': '${API_KEY}' }"
DEBUG: "true" # for reasons I don't understand, auth only runs with debug right now. don't question it, unless you want to fix it
DJANGO_SETTINGS_MODULE: "spongeauth.settings.prod"
networks:
- web
redis:
image: redis:6.2.1
networks:
- web
networks:
web:
name: traefik-overlay
external: true
volumes:
db_data:
hangar_data: