-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 955 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 955 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
34
35
36
37
# syntax=docker/dockerfile:1.9
FROM ghcr.io/astral-sh/uv:python3.12-bookworm
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PYTHON_DOWNLOADS=0 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app
WORKDIR /app
# Install dependencies first (for layer caching)
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project --no-dev
# Copy application source and install
COPY ./src /app/src
COPY ./pyproject.toml /app/pyproject.toml
COPY ./uv.lock /app/uv.lock
COPY ./alembic.ini /app/alembic.ini
COPY --chmod=0755 ./entrypoint.sh /app/entrypoint.sh
# Project layer
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-dev
# Install Playwright
RUN .venv/bin/playwright install --with-deps chromium
# Create data directory
RUN mkdir -p /app/data
CMD ["/app/entrypoint.sh"]