2024-03-12 19:02:13 +08:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
services:
|
|
|
|
monkeytype-frontend:
|
|
|
|
container_name: monkeytype-frontend
|
|
|
|
image: monkeytype/monkeytype-frontend:latest
|
|
|
|
ports:
|
|
|
|
- "${HTTP_PORT:-8080}:80"
|
|
|
|
restart: on-failure
|
|
|
|
depends_on:
|
|
|
|
monkeytype-backend:
|
|
|
|
condition: service_healthy
|
|
|
|
env_file:
|
|
|
|
- path: ./.env
|
|
|
|
required: true
|
|
|
|
environment:
|
2024-05-13 18:26:46 +08:00
|
|
|
- FIREBASE_APIKEY=${FIREBASE_APIKEY:-}
|
|
|
|
- FIREBASE_AUTHDOMAIN=${FIREBASE_AUTHDOMAIN:-}
|
|
|
|
- FIREBASE_PROJECTID=${FIREBASE_PROJECTID:-}
|
|
|
|
- FIREBASE_STORAGEBUCKET=${FIREBASE_STORAGEBUCKET:-}
|
|
|
|
- FIREBASE_MESSAGINGSENDERID=${FIREBASE_MESSAGINGSENDERID:-}
|
|
|
|
- FIREBASE_APPID=${FIREBASE_APPID:-}
|
2024-03-12 19:02:13 +08:00
|
|
|
- MONKEYTYPE_BACKENDURL=${MONKEYTYPE_BACKENDURL}
|
2024-05-13 18:26:46 +08:00
|
|
|
- RECAPTCHA_SITE_KEY=${RECAPTCHA_SITE_KEY:-}
|
2024-03-12 19:02:13 +08:00
|
|
|
|
|
|
|
monkeytype-backend:
|
|
|
|
container_name: monkeytype-backend
|
|
|
|
image: monkeytype/monkeytype-backend:latest
|
|
|
|
ports:
|
|
|
|
- "${BACKEND_PORT:-5005}:5005"
|
|
|
|
restart: on-failure
|
|
|
|
environment:
|
|
|
|
- DB_NAME=monkeytype
|
|
|
|
- DB_URI=mongodb://monkeytype-mongodb:27017
|
|
|
|
- REDIS_URI=redis://monkeytype-redis:6379
|
|
|
|
- FRONTEND_URL=${MONKEYTYPE_FRONTENDURL}
|
2024-05-13 18:26:46 +08:00
|
|
|
- RECAPTCHA_SECRET=${RECAPTCHA_SECRET:-}
|
2024-03-12 19:02:13 +08:00
|
|
|
volumes:
|
2024-04-02 17:54:57 +08:00
|
|
|
#uncomment to enable the account system, check the SELF_HOSTING.md file
|
|
|
|
#- type: bind
|
|
|
|
# source: ./serviceAccountKey.json
|
2024-07-22 21:08:11 +08:00
|
|
|
# target: /app/backend/src/credentials/serviceAccountKey.json
|
2024-04-02 17:54:57 +08:00
|
|
|
# read_only: true
|
2024-03-12 19:02:13 +08:00
|
|
|
- type: bind
|
|
|
|
source: ./backend-configuration.json
|
2024-07-26 01:45:54 +08:00
|
|
|
target: /app/backend/dist/backend-configuration.json
|
2024-03-12 19:02:13 +08:00
|
|
|
read_only: true
|
|
|
|
depends_on:
|
|
|
|
monkeytype-redis:
|
|
|
|
condition: service_healthy
|
|
|
|
monkeytype-mongodb:
|
|
|
|
condition: service_healthy
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "nc", "-z", "-v", "localhost", "5005"]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 15
|
|
|
|
start_period: 5s
|
|
|
|
|
|
|
|
monkeytype-redis:
|
|
|
|
container_name: monkeytype-redis
|
|
|
|
image: redis:6.2.6
|
|
|
|
#uncomment if you want to expose the redis server
|
|
|
|
#ports:
|
|
|
|
# - "${REDIS_PORT:-6379}:6379"
|
|
|
|
restart: on-failure
|
|
|
|
volumes:
|
|
|
|
- redis-data:/data
|
|
|
|
healthcheck:
|
|
|
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 15
|
|
|
|
start_period: 10s
|
|
|
|
|
|
|
|
monkeytype-mongodb:
|
|
|
|
container_name: monkeytype-mongodb
|
|
|
|
image: mongo:5.0.8
|
|
|
|
restart: on-failure
|
|
|
|
volumes:
|
|
|
|
- mongo-data:/data/db
|
|
|
|
#uncomment if you want to expose the mongodb server
|
|
|
|
#ports:
|
|
|
|
# - "${MONGO_PORT:-27017}:27017"
|
|
|
|
healthcheck:
|
|
|
|
test: echo 'db.stats().ok' | mongo localhost:27017/test --quiet
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 15
|
|
|
|
start_period: 10s
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
mongo-data:
|
|
|
|
name: monkeytype_mongo_data
|
|
|
|
redis-data:
|
|
|
|
name: monkeytype_redis_data
|