version: "3" services: redis: image: redis:4.0-alpine container_name: oj_redis restart: always volumes: - $PWD/data/redis:/data postgres: image: 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 oj-backend: image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_backend container_name: oj_backend depends_on: - redis - postgres volumes: - $PWD/OnlineJudge:/app - $PWD/log:/data/log - $PWD/data/test_case:/data/test_case - $PWD/data/avatar:/data/avatar environment: - REDIS_HOST=redis - REDIS_PORT=6379 - POSTGRES_HOST=postgres - POSTGRES_PORT=5432 - POSTGRES_DB=onlinejudge - POSTGRES_USER=onlinejudge - POSTGRES_PASSWORD=onlinejudge - JUDGE_SERVER_TOKEN=CHANGE_THIS judge-server: image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server container_name: judge_server read_only: true depends_on: - oj-backend 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/test_case:/test_case:ro - $PWD/log:/log - $PWD/JudgeServer/server:/code:ro environment: - service_url=http://judge-server:8080 - OJ_WEB_SERVER_PORT_8080_TCP_ADDR=oj-backend - OJ_WEB_SERVER_PORT_8080_TCP_PORT=8080 - TOKEN=CHANGE_THIS oj-frontend: image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/oj_frontend container_name: oj_frontend depends_on: - oj-backend volumes: - $PWD/OnlineJudgeFE:/OJ_FE - $PWD/data/avatar:/data/avatar - $PWD/log:/var/log/nginx ports: - "0.0.0.0:80:80"