OnlineJudgeDeploy/docker-compose.yml

67 lines
1.7 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:
image: registry.docker-cn.com/library/redis:4.0-alpine
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:
image: registry.docker-cn.com/library/postgres:10-alpine
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
- /judger_run:exec,mode=777
- /spj:exec,mode=777
2018-03-04 22:48:59 +00:00
# - /dev/shm:mode=777
2017-10-31 12:26:36 +00:00
volumes:
2017-11-25 04:04:02 +00:00
- $PWD/data/backend/test_case:/test_case:ro
- $PWD/data/judge_server:/log
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
2017-11-25 04:04:02 +00:00
oj-backend:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_backend
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"