OnlineJudgeDeploy/docker-compose.yml

61 lines
1.5 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
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
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:
- service_url=http://judge-server:8080
2017-11-25 04:04:02 +00:00
- service_discovery_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
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-10-31 12:26:36 +00:00
ports:
2017-11-25 04:04:02 +00:00
- "0.0.0.0:80:8000"
- "0.0.0.0:443:1443"