Add Docker support with Dockerfile and docker-compose.yml

- Introduced a Dockerfile for building the application using a multi-stage build process.
- Added docker-compose.yml to define services for the application and PostgreSQL database.
- Updated README.md with instructions for running the application using Docker and Docker Compose.
This commit is contained in:
Ben Melchior
2025-04-15 20:26:06 +02:00
parent 8d50c1e962
commit a70c80a557
3 changed files with 92 additions and 0 deletions

31
docker-compose.yml Normal file
View File

@@ -0,0 +1,31 @@
version: '3.8'
services:
app:
build: .
ports:
- "3000:3000"
depends_on:
- db
environment:
- DATABASE_URL=postgres://postgres:postgres@db/hospitaldb
- HOST=0.0.0.0
- PORT=3000
volumes:
- ./.env:/usr/src/app/.env
restart: unless-stopped
db:
image: postgres:14
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=hospitaldb
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
volumes:
postgres_data: