Skip to content

Commit

Permalink
improve dependency, restart and more
Browse files Browse the repository at this point in the history
  • Loading branch information
Echomo-Xinyu committed Nov 9, 2024
1 parent 37b11e0 commit 2d005fc
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,56 @@ services:
build: ./backend/question-service
ports:
- "3002:3002"
restart: on-failure

user:
build: ./backend/user-service
ports:
- "3001:3001"
restart: on-failure

code-execution-rabbitmq:
image: rabbitmq:4.0-management
ports:
- "7004:5672"
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 10s
timeout: 5s
retries: 5

code-execution-redis:
image: redis:alpine
ports:
- "7001:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5

code-execution-server:
build: ./backend/code-execution-service/server
ports:
- "7002:7002"
depends_on:
- code-execution-rabbitmq
- code-execution-redis
code-execution-rabbitmq:
condition: service_healthy
code-execution-redis:
condition: service_healthy

code-execution-worker:
build: ./backend/code-execution-service/worker
pids_limit: 60
cpus: 1
mem_limit: 150M
depends_on:
- code-execution-rabbitmq
- code-execution-redis
code-execution-rabbitmq:
condition: service_healthy
code-execution-redis:
condition: service_healthy
deploy:
replicas: 4
replicas: 1
restart_policy:
condition: any
delay: 3s
Expand Down Expand Up @@ -66,9 +82,6 @@ services:
condition: service_healthy
ports:
- "3003:3003"
environment:
DATABASE_URL: "file:./dev.db"
RABBITMQ_URL: "amqp://rabbitmq:5672"

collaboration:
build: ./backend/collaboration-service
Expand All @@ -77,8 +90,9 @@ services:

frontend:
build: ./frontend
env_file:
- ./frontend/nginx/.env
environment:
- QUESTION_SERVICE_URL=http://question:3002
- USER_SERVICE_URL=http://user:3001/
ports:
- "80:80"
depends_on:
Expand Down

0 comments on commit 2d005fc

Please sign in to comment.