OnlineJudgeDeploy/docker-compose.yml
2017-11-29 10:01:49 +08:00

61 lines
1.5 KiB
YAML

version: "3"
services:
oj-redis:
image: registry.docker-cn.com/library/redis:4.0-alpine
container_name: oj-redis
restart: always
volumes:
- $PWD/data/redis:/data
oj-postgres:
image: registry.docker-cn.com/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
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:
- $PWD/data/backend/test_case:/test_case:ro
- $PWD/data/judge_server:/log
environment:
- service_url=http://judge-server:8080
- service_discovery_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
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
ports:
- "0.0.0.0:80:8000"
- "0.0.0.0:443:1443"