ADD Docker support

This commit is contained in:
Esa Kataja
2024-11-14 15:52:12 +02:00
parent 474c677d78
commit b32e689d11
2 changed files with 24 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
FROM ghcr.io/astral-sh/uv:python3.12-alpine
WORKDIR /app
ENV UV_COMPILE_BYTECODE=1
ADD ./pyproject.toml .
ADD ./uv.lock .
ADD ./src .
RUN uv sync --frozen --no-dev
ENV PATH="/app/.venv/bin:$PATH"
ENTRYPOINT []
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
+8
View File
@@ -0,0 +1,8 @@
services:
web:
# Build the image from the Dockerfile in the current directory
build: .
# Host the FastAPI application on port 8000
ports:
- "8000:8000"