diff --git a/Dockerfile b/Dockerfile index e69de29..a4d8164 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e69de29..e5a7d57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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"