Description
There is no Docker configuration for the project. Setting up a development environment requires manually installing Python, PostgreSQL, and configuring dependencies. A Docker setup would streamline onboarding and provide consistent environments across development, testing, and production.
Recommended Enhancement
-
Create a Dockerfile:
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]
-
Create a docker-compose.yml for local development:
version: '3.8'
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: edutrack
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
- ./seed_data.sql:/docker-entrypoint-initdb.d/02-seed.sql
web:
build: .
ports:
- "5000:5000"
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/edutrack
SECRET_KEY: ${SECRET_KEY:-change-me-in-production}
TEACHER_SUPERKEY: ${TEACHER_SUPERKEY:-change-me-in-production}
depends_on:
- db
volumes:
pgdata:
-
Add a .dockerignore file:
.venv/
__pycache__/
*.pyc
.env
.git/
Description
There is no Docker configuration for the project. Setting up a development environment requires manually installing Python, PostgreSQL, and configuring dependencies. A Docker setup would streamline onboarding and provide consistent environments across development, testing, and production.
Recommended Enhancement
Create a
Dockerfile:Create a
docker-compose.ymlfor local development:Add a
.dockerignorefile: