Skip to content

Tejen1710/Module9-Docker-FastAPI-Postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI + PostgreSQL + pgAdmin (Docker Compose)

This project demonstrates how to set up a FastAPI application with PostgreSQL and pgAdmin using Docker Compose. It provides a backend API built with FastAPI, a PostgreSQL database, and a pgAdmin interface for database management.

Features

  • FastAPI: A modern, fast (high-performance) web framework for building APIs with Python.
  • PostgreSQL: A powerful, open-source object-relational database system.
  • pgAdmin: A web-based GUI for managing PostgreSQL databases.
  • Docker Compose: Simplifies the process of setting up and managing multi-container Docker applications.

Prerequisites

  • Docker and Docker Compose installed on your system.
  • Python (if you want to manage dependencies locally).

Setup Instructions

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-folder>
  2. Copy the example environment file and configure it:

    cp .env.example .env

    Update the .env file with your desired configuration.

  3. Build and start the Docker containers:

    docker compose up --build
  4. Access the application:

Project Structure

.
├── backend/
│   ├── Dockerfile          # Dockerfile for the FastAPI backend
│   ├── requirements.txt    # Python dependencies
│   └── app/
│       └── main.py         # FastAPI application entry point
├── docs/
│   ├── sql_commands.sql    # SQL commands for database setup
│   └── screenshots/        # Screenshots for documentation
├── docker-compose.yml      # Docker Compose configuration
└── README.md               # Project documentation

Usage

  • To stop the containers:
    docker compose down
  • To rebuild the containers after making changes:
    docker compose up --build

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published