Jotzy/backend/Dockerfile
2026-01-06 12:51:40 +00:00

21 lines
681 B
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# backend/Dockerfile
FROM python:3.11-slim
# 1⃣ Set a deterministic working directory
WORKDIR /app
# 2⃣ Copy only the dependency list first this lets Docker cache the layer
COPY requirements.txt .
# 3⃣ Install Python deps (no cache to keep the image small)
RUN pip install --no-cache-dir -r requirements.txt
# 4⃣ Now copy the actual source code
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.
# In production youd drop the `--reload` flag.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]