A Simple Express API that serves as a backend for managing a collection of books.
162
This repository contains a simple Express API designed for managing a collection of books within a PostgreSQL database. The API supports CRUD operations for books, authors, and categories.
To set up the server, create a docker-compose.yml file with the following content:
version: "3.8"
services:
postgres:
image: postgres:latest
container_name: postgres_db
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres123}
POSTGRES_DB: ${POSTGRES_DB:-bookstoreDB}
server:
image: vasujain275/bookstore-api:main
container_name: bookstore_api
ports:
- "8069:8069"
depends_on:
- postgres
environment:
- NODE_ENV=production
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres123}@postgres:5432/${POSTGRES_DB:-bookstoreDB}
- PORT=8069
After setting up the docker-compose.yml file, run the following command to deploy database migrations:
docker exec -it bookstore_api /bin/bash -c "cd /app && pnpm dlx prisma migrate deploy"
More info at - https://github.com/vasujain275/bookstore-api
Content type
Image
Digest
sha256:f88697aa6…
Size
586.3 MB
Last updated
over 1 year ago
docker pull vasujain275/bookstore-api:main