2018-01-29 20:56:08 +00:00
|
|
|
services:
|
2025-03-12 17:00:38 +00:00
|
|
|
server:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: ./Dockerfile
|
|
|
|
|
target: server
|
2025-09-25 22:49:31 +00:00
|
|
|
restart: unless-stopped
|
2025-03-12 17:00:38 +00:00
|
|
|
depends_on:
|
2025-09-25 22:49:31 +00:00
|
|
|
mongo:
|
|
|
|
|
condition: service_healthy
|
2025-03-12 17:00:38 +00:00
|
|
|
environment:
|
2025-09-25 22:49:31 +00:00
|
|
|
- NODE_DB_URI=mongodb://mongo/habitica?replicaSet=rs # adjust if you run an external Mongo database
|
|
|
|
|
- BASE_URL=http://127.0.0.1:3000 # change this to the URL under which your instance will be reachable
|
2025-03-12 17:00:38 +00:00
|
|
|
- INVITE_ONLY=false # change to `true` after registration of initial users, to restrict further registrations
|
2025-09-25 22:49:31 +00:00
|
|
|
- PUSH_CONFIGS_UNIFIEDPUSH_URL=${UP_BASE_URL:-} # optional: base URL for UnifiedPush distributor
|
|
|
|
|
- PUSH_CONFIGS_UNIFIEDPUSH_AUTHORIZATION=${UP_AUTH_HEADER:-} # optional: Authorization header for UnifiedPush
|
2018-01-29 20:56:08 +00:00
|
|
|
networks:
|
|
|
|
|
- habitica
|
|
|
|
|
ports:
|
|
|
|
|
- "3000:3000"
|
|
|
|
|
mongo:
|
2025-03-12 17:00:38 +00:00
|
|
|
image: docker.io/mongo:latest
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
hostname: mongo
|
|
|
|
|
command: ["--replSet", "rs", "--bind_ip_all", "--port", "27017"]
|
|
|
|
|
healthcheck:
|
2025-09-25 22:49:31 +00:00
|
|
|
test: ["CMD-SHELL", "echo \"try { rs.status() } catch (err) { rs.initiate({_id: 'rs', members: [{ _id: 0, host: 'mongo:27017' }]}) }\" | mongosh --quiet --port 27017"]
|
2025-03-12 17:00:38 +00:00
|
|
|
interval: 10s
|
|
|
|
|
timeout: 30s
|
|
|
|
|
start_period: 0s
|
|
|
|
|
start_interval: 1s
|
|
|
|
|
retries: 30
|
|
|
|
|
volumes:
|
|
|
|
|
- ./mongodb-data/db:/data/db:rw,Z
|
|
|
|
|
- ./mongodb-data/dbconf:/data/configdb:Z
|
2018-01-29 20:56:08 +00:00
|
|
|
networks:
|
2025-03-12 17:00:38 +00:00
|
|
|
habitica:
|
|
|
|
|
aliases:
|
|
|
|
|
- mongo
|
2018-01-29 20:56:08 +00:00
|
|
|
networks:
|
|
|
|
|
habitica:
|
|
|
|
|
driver: bridge
|