48 lines
1.8 KiB
YAML
48 lines
1.8 KiB
YAML
services:
|
|
watcher:
|
|
build:
|
|
context: ..
|
|
dockerfile: watcher/Dockerfile
|
|
image: atproto-1440news-watcher
|
|
container_name: atproto-1440news-watcher
|
|
restart: unless-stopped
|
|
stop_grace_period: 30s
|
|
env_file:
|
|
- oauth.env
|
|
environment:
|
|
DB_HOST: infra-postgres
|
|
DB_PORT: 5432
|
|
DB_USER: dba_1440_news
|
|
DB_PASSWORD_FILE: /run/secrets/db_password
|
|
DB_NAME: db_1440_news
|
|
OAUTH_BASE_URL: https://dashboard.1440.news
|
|
secrets:
|
|
- db_password
|
|
networks:
|
|
- atproto
|
|
labels:
|
|
- "traefik.enable=true"
|
|
# Production: HTTPS for dashboard.1440.news and watcher.1440.news
|
|
- "traefik.http.routers.watcher-1440.rule=Host(`dashboard.1440.news`) || Host(`watcher.1440.news`)"
|
|
- "traefik.http.routers.watcher-1440.entrypoints=https"
|
|
- "traefik.http.routers.watcher-1440.tls.certresolver=letsencrypt-dns"
|
|
# Production: HTTP to HTTPS redirect
|
|
- "traefik.http.routers.watcher-1440-redirect.rule=Host(`dashboard.1440.news`) || Host(`watcher.1440.news`)"
|
|
- "traefik.http.routers.watcher-1440-redirect.entrypoints=http"
|
|
- "traefik.http.routers.watcher-1440-redirect.middlewares=https-redirect"
|
|
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
|
|
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
|
|
# Local development
|
|
- "traefik.http.routers.watcher-1440-local.rule=Host(`dashboard.1440.localhost`) || Host(`watcher.1440.localhost`)"
|
|
- "traefik.http.routers.watcher-1440-local.entrypoints=http"
|
|
# Shared service
|
|
- "traefik.http.services.watcher-1440.loadbalancer.server.port=4321"
|
|
|
|
secrets:
|
|
db_password:
|
|
file: ../../../infra/postgres/secrets/dba_1440_news_password.txt
|
|
|
|
networks:
|
|
atproto:
|
|
external: true
|