Initial commit: Docker compose structure
This commit is contained in:
45
compose.yaml
Normal file
45
compose.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
services:
|
||||
backend:
|
||||
container_name: backend
|
||||
restart: always
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
networks:
|
||||
- proxy
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
frontend:
|
||||
container_name: frontend
|
||||
restart: always
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
networks:
|
||||
- proxy
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
db:
|
||||
image: postgres:alpine3.23
|
||||
container_name: db
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: app_db
|
||||
volumes:
|
||||
- ./db:/var/lib/postgresql/data
|
||||
networks:
|
||||
- proxy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d app_db"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
Reference in New Issue
Block a user