Refactor Docker setup and update API description
- Updated docker-compose.yml to use context and dockerfile for the app service, and removed unnecessary db service configuration. - Modified Dockerfile to use the official Rust nightly image and streamlined the build process with updated working directories and runtime dependencies. - Changed API description in root handler to reflect the correct endpoint for fetching the current hospital.
This commit is contained in:
@@ -2,30 +2,13 @@ version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
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:
|
||||
- HOST=${HOST}
|
||||
- PORT=${PORT}
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
restart: unless-stopped
|
||||
Reference in New Issue
Block a user