This project is a library management system containerized with Docker, including a Node.js backend, PostgreSQL database, and pgAdmin.
Ensure the following tools are installed:
PORT=4000
DB_HOST=postgres
DB_USERNAME=postgres
DB_PASSWORD=password
DB_NAME=library_DB
- Runs on port
5432
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
- Runs on port
8080
-
Clone the repository:
git clone https://github.com/Parth002933v/library_management_system.git cd library_management_system
-
Build and start the application using Docker Compose:
docker-compose up --build
-
The backend will be accessible at
http://localhost:4000
, and pgAdmin will be available athttp://localhost:8080
. -
After Docker is running successfully, open the Node.js container terminal:
docker exec -it backend /bin/sh
-
Run the database migrations and seed the data:
pnpm run migrate:latest pnpm run seed:run
To stop and remove the containers, use:
docker-compose down
- You can modify environment variables as needed in the
docker-compose.yaml
. - Ensure the database is properly seeded with the
pnpm
commands mentioned above.