-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 959 Bytes
/
Dockerfile
File metadata and controls
35 lines (27 loc) · 959 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
# cache dependencies
FROM python:3.14-slim AS python_cache
COPY --from=ghcr.io/astral-sh/uv:0.10 /uv /uvx /bin/
RUN apt-get update && apt-get install gcc ldap-utils libsasl2-dev libldap2-dev -y
FROM python_cache AS dependencies
ENV UV_LINK_MODE=copy
ENV UV_PYTHON_DOWNLOADS=0
ENV UV_COMPILE_BYTECODE=1
ENV UV_PROJECT_ENVIRONMENT=/opt/venv
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=uv.lock,target=uv.lock \
uv sync --frozen --no-install-project
# build and start
FROM python:3.14-slim AS build
EXPOSE 80
RUN apt-get update && apt-get install -y --no-install-recommends \
libldap2 \
&& rm -rf /var/lib/apt/lists/*
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR /app
COPY --from=dependencies /opt/venv /opt/venv
COPY . .
RUN strawberry export-schema main > schema.graphql
ENTRYPOINT [ "./entrypoint.sh" ]