Files
NotyKT/docs/pages/noty-api/setting-up-docker-locally.md
Shreyas Patil 8412b49b6e [noty-api] Document Koyeb migration and Docker setup
- Added deployment guide for Koyeb, replacing Railway and Heroku due to new charges.
- Archived Railway and Heroku deployment documentation for historical reference.
- Added Docker setup guide for consistent local development.
2025-06-14 23:31:50 +05:30

1.5 KiB

Docker Usage

Docker provides a consistent and isolated environment for running the NotyKT API and its dependencies. This approach is recommended for development to ensure consistency across different environments.

Prerequisites

Before you begin, make sure you have the following installed on your machine:

Running with Docker

Follow these steps to run the NotyKT API using Docker:

  1. Clone the repository
  2. Navigate to the project root directory (noty-api)
  3. Create a .env file in the root directory with the required environment variables:
SECRET_KEY=ANY_RANDOM_SECRET_VALUE

PGPORT=5432
PGHOST=db
PGDATABASE=notykt_dev_db
PGUSER=postgres
PGPASSWORD=postgres

DATABASE_DRIVER=org.postgresql.ds.PGSimpleDataSource
DATABASE_MAX_POOL_SIZE=10
  1. Run the following command to start the application and database:
docker-compose up

This will start:

  • PostgreSQL database on port 5432
  • NotyKT API application on port 8080

You can access the API at http://localhost:8080 once the services are up and running.

Additional Docker Commands

Here are some useful Docker commands for managing the NotyKT API:

  • To run the services in the background:

    docker-compose up -d
    
  • To stop the services:

    docker-compose down
    
  • To rebuild the application after making changes:

    docker-compose up --build
    
  • To view logs:

    docker-compose logs -f