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:
31
docker-compose.yml
Normal file
31
docker-compose.yml
Normal 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:
|
||||
Reference in New Issue
Block a user