Add Docker

This commit is contained in:
Esa Kataja
2025-05-04 21:29:04 +03:00
parent e0521d8980
commit ffdb3cbecd
3 changed files with 31 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
.git
*.duckdb
.env
__pycache__
+15
View File
@@ -0,0 +1,15 @@
FROM python:3.12-slim AS base
FROM base AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
WORKDIR /app
COPY pyproject.toml uv.lock /app/
RUN uv sync --frozen --no-install-project --no-dev
COPY src /app
RUN uv sync --frozen --no-dev
FROM base
COPY --from=builder /app /app
ENV PATH="/app/.venv/bin:$PATH"
WORKDIR /app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
+12
View File
@@ -0,0 +1,12 @@
version: '3.8'
services:
backend:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- ./data:/app/data
restart: unless-stopped