-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 1022 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 1022 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
FROM tiangolo/uwsgi-nginx-flask:python3.9
RUN apt-get update && apt-get install -y gcc curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN pip install uv
# Enable bytecode compilation and avoid hardlinks in mounted cache volumes.
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
ENV UV_PYTHON_DOWNLOADS=0
RUN git config --global http.sslVerify false && \
mkdir -p /home/nginx/.cloudvolume/secrets && \
chown -R nginx /home/nginx && \
usermod -d /home/nginx -s /bin/bash nginx
WORKDIR /app
# Install runtime dependencies from the lockfile before copying source.
COPY uv.lock pyproject.toml ./
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"
RUN --mount=type=cache,target=/root/.cache/uv \
UV_VENV_ARGS="--system-site-packages" uv sync --frozen --no-install-project --no-default-groups
ENV UWSGI_INI /app/uwsgi.ini
ENV PATH /app/.venv/bin:/home/nginx/google-cloud-sdk/bin:/root/google-cloud-sdk/bin:$PATH
ENV PYTHONNOUSERSITE=1
COPY timeout.conf /etc/nginx/conf.d/
COPY . /app