Skip to content

Commit

Permalink
Update docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 11, 2024
1 parent 23be771 commit ef5872a
Showing 1 changed file with 59 additions and 4 deletions.
63 changes: 59 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,78 @@
version: '3'
version: '3.8'

services:
app:
build: .
build:
context: .
dockerfile: Dockerfile
args:
- NODE_ENV=production
- API_KEY=super_secret_api_key
ports:
- "8000:8000"
depends_on:
- db
- redis
- rabbitmq
environment:
- DATABASE_URL=postgres://user:password@db:5432/database
- DATABASE_URL=postgres://username:[email protected]:5432/database
- REDIS_URL=redis://redis:6379
- RABBITMQ_URL=amqp://rabbitmq:5672
- API_KEY=super_secret_api_key
deploy:
mode: replicated
replicas: 3
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
update_config:
parallelism: 2
delay: 10s
rollback_config:
parallelism: 2
delay: 10s

db:
image: postgres
environment:
- POSTGRES_USER=user
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=database
volumes:
- db-data:/var/lib/postgresql/data
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3

redis:
image: redis:alpine
ports:
- "6379:6379"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3

rabbitmq:
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3

volumes:
db-data:

0 comments on commit ef5872a

Please sign in to comment.