OnlineJudgeDeploy/docker-compose.yml
2018-06-28 17:37:46 +08:00

65 lines
1.6 KiB
YAML

version: "3"
services:
oj-redis:
image: docker.mirrors.ustc.edu.cn/library/redis:4.0-alpine
container_name: oj-redis
restart: always
volumes:
- $PWD/data/redis:/data
oj-postgres:
image: docker.mirrors.ustc.edu.cn/library/postgres:10-alpine
container_name: oj-postgres
restart: always
volumes:
- $PWD/data/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=onlinejudge
- POSTGRES_USER=onlinejudge
- POSTGRES_PASSWORD=onlinejudge
judge-server:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
container_name: judge-server
restart: always
read_only: true
cap_drop:
- SETPCAP
- MKNOD
- NET_BIND_SERVICE
- SYS_CHROOT
- SETFCAP
- FSETID
tmpfs:
- /tmp
volumes:
- $PWD/data/backend/test_case:/test_case:ro
- $PWD/data/judge_server/log:/log
- $PWD/data/judge_server/run:/judger
environment:
- SERVICE_URL=http://judge-server:8080
- BACKEND_URL=http://oj-backend:8000/api/judge_server_heartbeat/
- TOKEN=CHANGE_THIS
oj-backend:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_backend
container_name: oj-backend
restart: always
depends_on:
- oj-redis
- oj-postgres
- judge-server
volumes:
- $PWD/data/backend:/data
environment:
- POSTGRES_DB=onlinejudge
- POSTGRES_USER=onlinejudge
- POSTGRES_PASSWORD=onlinejudge
- JUDGE_SERVER_TOKEN=CHANGE_THIS
# - FORCE_HTTPS=1
# - STATIC_CDN_HOST=cdn.oj.com
ports:
- "0.0.0.0:80:8000"
- "0.0.0.0:443:1443"