Created
April 26, 2025 18:45
-
-
Save avirajkhare00/5f58938e72578e7ca07b94eddec643d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
# Node.js API service | |
api: | |
image: avirajkhare00/library-api:latest | |
ports: | |
- "3000:3000" | |
environment: | |
- NODE_ENV=production | |
- DB_HOST=postgres | |
- DB_PORT=5432 | |
- DB_USER=postgres | |
- DB_PASSWORD=postgres | |
- DB_NAME=library | |
depends_on: | |
- postgres | |
networks: | |
- library-network | |
restart: unless-stopped | |
# PostgreSQL database | |
postgres: | |
image: postgres:14-alpine | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
- POSTGRES_DB=library | |
volumes: | |
- postgres-data:/var/lib/postgresql/data | |
networks: | |
- library-network | |
restart: unless-stopped | |
# Migration service to set up schema and seed data | |
migrations: | |
image: avirajkhare00/library-migrations:latest | |
environment: | |
- DB_HOST=postgres | |
- DB_PORT=5432 | |
- DB_USER=postgres | |
- DB_PASSWORD=postgres | |
- DB_NAME=library | |
depends_on: | |
- postgres | |
networks: | |
- library-network | |
restart: "no" | |
networks: | |
library-network: | |
driver: bridge | |
volumes: | |
postgres-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment