Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ TodoList API

A simple todo list API that runs in Docker containers.

🚀 How to Build and Start

Step 1: Create a .env file

Create a file named .env in the TodoList-API folder with these contents:

DB_USER=myuser
DB_PASSWORD=mypassword
DB_NAME=tododb
DB_HOST=db
DB_PORT=5432

Note: Change myuser and mypassword to whatever you want.

Step 2: Enable the web service

Open docker-compose.yml and uncomment the web service section (remove the # symbols from lines 22-35).

Step 3: Build and start the application

Open a terminal in the TodoList-API folder and run:

docker-compose up --build

This will:

  • Build the Docker image for the FastAPI application
  • Start the PostgreSQL database container
  • Start the FastAPI web application container
  • Create the necessary database tables automatically

Step 4: Access the API

Once it's running, open your browser and go to:

🛑 Stopping the Application

Press Ctrl+C in the terminal, then run:

docker-compose down

📝 Notes

  • The database data is saved in a Docker volume, so your data persists even if you stop the containers
  • To completely reset everything (including database data), run: docker-compose down -v
  • If you only want to run the database, you can leave the web service commented out in docker-compose.yml

About

A lightweight, Dockerized FastAPI + PostgreSQL todo list REST API with basic CRUD operations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages