Skip to content

Dockerize the app with docker-compose #13

Description

@Navashub

Description

Make the project runnable anywhere with a single command using Docker and docker-compose.

What to do

  • Write a Dockerfile for the FastAPI app:
    • Base: python:3.11-slim
    • Install dependencies, copy source, expose port 8000, run uvicorn
  • Write a docker-compose.yml with two services:
    • app — the FastAPI container
    • db — a PostgreSQL container
  • The app service should depend on db and read DATABASE_URL from compose environment
  • Add a Makefile with:
    • make updocker-compose up --build
    • make downdocker-compose down
    • make logsdocker-compose logs -f
  • Update README with Docker setup instructions

Acceptance Criteria

  • make up starts both services with no manual steps
  • http://localhost:8000/docs works after running make up
  • The app connects to the PostgreSQL container (not SQLite)
  • make down stops and removes containers cleanly

Difficulty

🔴 Advanced

Metadata

Metadata

Assignees

No one assigned

    Labels

    advancedAuth, testing, DevOpsdevopsDocker, PostgreSQL, deployment

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions