-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 817 Bytes
/
Dockerfile
File metadata and controls
33 lines (23 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_PROJECT_ENV=.venv \
PATH="/root/.local/bin:${PATH}"
# System deps for building psycopg2 and for runtime utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential gcc libpq-dev curl ca-certificates netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
WORKDIR /app
# Copy just dependency files
COPY pyproject.toml uv.lock ./
# Create venv and install deps via uv
RUN uv venv "${UV_PROJECT_ENV}" && uv sync --frozen
# Copy the rest of the app
COPY . .
# Make helper scripts executable
RUN chmod +x scripts/*.sh && chmod +x scripts/*.py
EXPOSE 8000
# Run migrations then start the API
ENTRYPOINT ["scripts/entrypoint.sh"]