56 lines
1.1 KiB
YAML
56 lines
1.1 KiB
YAML
version: "3.9"
|
|
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
container_name: swagshop-backend
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
env_file:
|
|
- ./.env
|
|
networks:
|
|
- internal
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/utils/health-check/"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
ports:
|
|
- "8000:8000"
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend/
|
|
container_name: swagshop-frontend
|
|
env_file:
|
|
- ./frontend/.env
|
|
ports:
|
|
- "5173:5173"
|
|
|
|
db:
|
|
image: postgres:16
|
|
container_name: swagshop-postgres
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
interval: 10s
|
|
retries: 5
|
|
start_period: 30s
|
|
timeout: 10s
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: swagshop
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
networks:
|
|
- internal
|
|
|
|
volumes:
|
|
pgdata:
|
|
|
|
networks:
|
|
internal:
|
|
driver: bridge
|