docker set up

This commit is contained in:
ANUJ7MADKE
2025-08-02 15:45:32 +05:30
parent cd43f0e98e
commit 933c0741ab
12 changed files with 191 additions and 13 deletions

35
docker-compose.yml Normal file
View File

@@ -0,0 +1,35 @@
services:
# Express Backend Service
server:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
depends_on:
- db
# React Frontend Service
client:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "5173:80"
depends_on:
- server
# PostgreSQL Database Service
db:
image: postgres:17-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata: