59 lines
No EOL
1.9 KiB
YAML
59 lines
No EOL
1.9 KiB
YAML
---
|
|
services:
|
|
server:
|
|
image: docker.io/awinterstein/habitica-server:${HABITICA_VERSION}
|
|
container_name: habitica
|
|
restart: unless-stopped
|
|
networks:
|
|
- traefik
|
|
- habitica
|
|
environment:
|
|
- NODE_DB_URI=mongodb://mongo/habitica
|
|
- BASE_URL=https://${HABITICA_DOMAIN}
|
|
- INVITE_ONLY=false
|
|
- EMAIL_SERVER_URL=${HABITICA_MAIL_SERVER}
|
|
- EMAIL_SERVER_PORT=${HABITICA_MAIL_PORT}
|
|
- EMAIL_SERVER_AUTH_USER=${HABITICA_MAIL_USER}
|
|
- EMAIL_SERVER_AUTH_PASSWORD=${HABITICA_MAIL_PASSWORD}
|
|
- ADMIN_EMAIL=${HABITICA_MAIL_ADDRESS}
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=traefik"
|
|
- "traefik.http.routers.habitica.entrypoints=http"
|
|
- "traefik.http.routers.habitica.rule=Host(`${HABITICA_DOMAIN}`)"
|
|
- "traefik.http.middlewares.habitica-https-redirect.redirectscheme.scheme=https"
|
|
- "traefik.http.routers.habitica.middlewares=habitica-https-redirect"
|
|
- "traefik.http.routers.habitica-secure.entrypoints=https"
|
|
- "traefik.http.routers.habitica-secure.rule=Host(`${HABITICA_DOMAIN}`)"
|
|
- "traefik.http.routers.habitica-secure.tls=true"
|
|
- "traefik.http.routers.habitica-secure.service=habitica"
|
|
- "traefik.http.services.habitica.loadbalancer.server.port=3000"
|
|
depends_on:
|
|
- mongo
|
|
|
|
mongo:
|
|
image: docker.io/mongo:${HABITICA_MONGO_VERSION}
|
|
restart: unless-stopped
|
|
container_name: habitica-db
|
|
hostname: mongo
|
|
networks:
|
|
habitica:
|
|
aliases:
|
|
- mongo
|
|
volumes:
|
|
- ./data/db:/data/db:rw
|
|
- ./data/dbconf:/data/configdb
|
|
command: ["--replSet", "rs", "--bind_ip_all", "--port", "27017"]
|
|
healthcheck:
|
|
test: echo "try { rs.status() } catch (err) { rs.initiate() }" | mongosh --port 27017 --quiet
|
|
interval: 10s
|
|
timeout: 30s
|
|
start_period: 0s
|
|
start_interval: 1s
|
|
retries: 30
|
|
|
|
networks:
|
|
habitica:
|
|
driver: bridge
|
|
traefik:
|
|
external: true |