Skip to content

Commit

Permalink
Merge pull request hngprojects#509 from hngprojects/Rob-in-son-patch-1-1
Browse files Browse the repository at this point in the history
Create docker-compose.yml
  • Loading branch information
Idimmusix authored Aug 8, 2024
2 parents a691a49 + 6ee659d commit 7e088b2
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
services:
backend:
build:
context: .
args:
- NODE_ENV=${NODE_ENV}
ports:
- 2222:8000
env_file:
- .env
environment:
DATABASE_URL: postgres:// ${DB_USER}:${DB_PASSWORD}@backend_db:5432/${DB_NAME}
networks:
- app
depends_on:
backend_db:
condition: service_healthy
restart: always
command: sh -c "sleep 10 && yarn start"

backend_db:
image: postgres:13
container_name: backend_db
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
#- ./init-scripts:/docker-entrypoint-initdb.d
ports:
- 5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app

# nginx:
# image: nginx:latest
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./nginx/sites-available/expressjs:/etc/nginx/sites-available/expressjs
# - ./nginx/sites-enabled:/etc/nginx/sites-enabled
# - /etc/letsencrypt:/etc/letsencrypt
# - ./nginx-entrypoint.sh:/docker-entrypoint.sh
# networks:
# - app
# depends_on:
# - backend
# restart: always

rabbitmq:
image: rabbitmq:3-management
ports:
- "5672"
# - "5672:5672"
- "15672"
# - "15672:15672"
networks:
- app

networks:
app:
driver: bridge

volumes:
postgres-data:

0 comments on commit 7e088b2

Please sign in to comment.