Skip to content

Commit

Permalink
add docker-compose.back
Browse files Browse the repository at this point in the history
  • Loading branch information
djeck1432 committed Dec 1, 2024
1 parent 37a8904 commit 31a68ed
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docker-compose.back.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: '3.8'

networks:
app_network:
driver: bridge

services:
backend:
build: .
container_name: backend_dev
volumes:
- ./entrypoint.sh:/app/entrypoint.sh
- .:/app
env_file:
- .env.dev
expose:
- "8000"
ports:
- "8000:8000"
networks:
- app_network
depends_on:
- db
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=spotnet
- DB_USER=postgres
- DB_PASSWORD=password

db:
image: postgres:14
container_name: postgres_dev
environment:
POSTGRES_DB: spotnet
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
volumes:
- postgres_data_dev:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d
networks:
- app_network
ports:
- "${DB_PORT:-5432}:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5

volumes:
postgres_data_dev:

0 comments on commit 31a68ed

Please sign in to comment.