- 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.
31 lines
588 B
YAML
31 lines
588 B
YAML
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: |