OnlineJudgeDeploy/docker-compose.yml

66 lines
1.6 KiB
YAML
Raw Normal View History

2017-10-31 12:26:36 +00:00
version: "3"
2017-06-10 17:21:54 +00:00
services:
2017-11-25 04:04:02 +00:00
oj-redis:
2018-11-05 02:36:05 +00:00
image: redis:4.0-alpine
2017-11-25 04:04:02 +00:00
container_name: oj-redis
2017-10-31 12:26:36 +00:00
restart: always
volumes:
- $PWD/data/redis:/data
2017-11-25 04:04:02 +00:00
oj-postgres:
2018-11-05 02:36:05 +00:00
image: postgres:10-alpine
2017-11-25 04:04:02 +00:00
container_name: oj-postgres
2017-10-31 12:26:36 +00:00
restart: always
volumes:
- $PWD/data/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=onlinejudge
- POSTGRES_USER=onlinejudge
- POSTGRES_PASSWORD=onlinejudge
2017-06-10 17:21:54 +00:00
2017-10-31 12:26:36 +00:00
judge-server:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
2017-11-25 04:04:02 +00:00
container_name: judge-server
2018-03-09 08:58:20 +00:00
restart: always
2017-10-31 12:26:36 +00:00
read_only: true
cap_drop:
- SETPCAP
- MKNOD
- NET_BIND_SERVICE
- SYS_CHROOT
- SETFCAP
- FSETID
tmpfs:
- /tmp
volumes:
2017-11-25 04:04:02 +00:00
- $PWD/data/backend/test_case:/test_case:ro
2018-05-05 08:33:33 +00:00
- $PWD/data/judge_server/log:/log
- $PWD/data/judge_server/run:/judger
2017-10-31 12:26:36 +00:00
environment:
2017-12-06 03:58:52 +00:00
- SERVICE_URL=http://judge-server:8080
- BACKEND_URL=http://oj-backend:8000/api/judge_server_heartbeat/
2017-10-31 12:26:36 +00:00
- TOKEN=CHANGE_THIS
2018-11-17 00:43:53 +00:00
# - judger_debug=1
2017-11-25 04:04:02 +00:00
oj-backend:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_backend
2017-11-25 04:04:02 +00:00
container_name: oj-backend
2018-03-09 08:58:20 +00:00
restart: always
2017-10-31 12:26:36 +00:00
depends_on:
2017-11-25 04:04:02 +00:00
- oj-redis
- oj-postgres
- judge-server
2017-10-31 12:26:36 +00:00
volumes:
2017-11-25 04:04:02 +00:00
- $PWD/data/backend:/data
environment:
- POSTGRES_DB=onlinejudge
- POSTGRES_USER=onlinejudge
- POSTGRES_PASSWORD=onlinejudge
- JUDGE_SERVER_TOKEN=CHANGE_THIS
2017-12-15 18:04:30 +00:00
# - FORCE_HTTPS=1
2018-01-02 12:21:06 +00:00
# - STATIC_CDN_HOST=cdn.oj.com
2017-10-31 12:26:36 +00:00
ports:
2017-11-25 04:04:02 +00:00
- "0.0.0.0:80:8000"
2018-01-02 12:21:06 +00:00
- "0.0.0.0:443:1443"