This commit is contained in:
Jamitz 2026-01-06 15:44:53 +00:00
parent 7087f21891
commit e3eac33abf

View file

@ -1,21 +1,17 @@
# backend/Dockerfile
FROM python:3.11-slim FROM python:3.11-slim
# 1⃣ Set a deterministic working directory
WORKDIR /app WORKDIR /app
# 2⃣ Copy only the dependency list first this lets Docker cache the layer
COPY requirements.txt . COPY requirements.txt .
# 3⃣ Install Python deps (no cache to keep the image small)
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# 4⃣ Now copy the actual source code
COPY ./app ./app COPY ./app ./app
# 5⃣ Expose the port FastAPI will listen on (optional but nice for docs)
EXPOSE 8000
# 6⃣ Run uvicorn with hotreload for local development. CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
# In production youd drop the `--reload` flag.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]