Skip to content

Commit 80e8cc2

Browse files
authored
feat: add Dockerfile (#3)
1 parent 04fac8d commit 80e8cc2

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM python:3.13-slim AS builder
2+
LABEL maintainer="Simone Locci <[email protected]>"
3+
4+
WORKDIR /build
5+
RUN pip install --no-cache-dir poetry
6+
COPY pyproject.toml poetry.lock ./
7+
RUN poetry config virtualenvs.create false \
8+
&& poetry install --no-root --only main
9+
10+
FROM python:3.13-slim
11+
LABEL maintainer="Simone Locci <[email protected]>"
12+
13+
ENV PYTHONDONTWRITEBYTECODE=1 \
14+
PYTHONUNBUFFERED=1
15+
16+
WORKDIR /app
17+
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
18+
COPY --from=builder /usr/local/bin /usr/local/bin
19+
COPY app ./app
20+
COPY log_config.yml .
21+
22+
EXPOSE 8000
23+
24+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-config", "log_config.yml"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Built to showcase best practices in Python backend development and serve as a so
1010
- 📄 OpenAPI docs auto-generated (`/docs`, `/redoc`)
1111
- ✅ Data validation and typing with Pydantic v2
1212
- 🧪 Async-ready test setup with `pytest`, `httpx`, `pytest-asyncio` (in progress)
13-
- 🐳 Minimal Docker support (in progress)
13+
- 🐳 Minimal Docker support
1414
- 🧰 Designed as a reusable starter template
1515

1616
## 📦 Technologies
1717

18-
- Python 3.11+
18+
- Python 3.13+
1919
- FastAPI
2020
- Uvicorn (ASGI server)
2121
- Pydantic v2

0 commit comments

Comments
 (0)