Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.35 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.35 KB

FastAPI-Postgres-Docker

This project sets up a Dockerized environment for a FastAPI application, PostgreSQL database, and NGINX as a reverse proxy. It allows you to quickly deploy and run a FastAPI application with PostgreSQL as the backend, all managed through Docker Compose.

Getting Started

Follow these instructions to get the project up and running on your local machine.

Prerequisites

Ensure you have the following installed on your machine:

Installation

  1. Clone the repository:

    git clone https://github.com/sudan94/fastapi-postgres-docker.git
    cd fastapi-postgres-docker
  2. Update the .env file with your database credentials:

    POSTGRES_USER=your_username
    POSTGRES_PASSWORD=your_password
    POSTGRES_SERVER=your_postgres_servername
    POSTGRES_PORT=your_postgres_running_port
    POSTGRES_DB=your_database
  3. Build and run the Docker containers:

    docker-compose up -d

Usage

After running docker-compose up -d, your FastAPI application will be accessible via NGINX at http://localhost:8080/fastapi/docs.


Enjoy building with FastAPI, PostgreSQL, and Docker! If you have any questions or run into issues, feel free to open an issue in the repository.