-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 931 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 931 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
38
39
FROM python:3.13-alpine3.20
RUN apk --no-cache add gcc build-base git openssl-dev libffi-dev
RUN addgroup -g 10000 user && \
adduser -S -u 10000 -G user -h /app user
ENV APP_HOME=/app
WORKDIR ${APP_HOME}
RUN chown -R user:user ${APP_HOME}
USER user
# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.4 /uv /uvx /bin/
ARG UV_EXTRA_ARGS="--no-dev"
# install deps
COPY pyproject.toml uv.lock ${APP_HOME}/
RUN uv sync --frozen --no-cache ${UV_EXTRA_ARGS} --compile-bytecode
COPY ./ ${APP_HOME}/
# set the virtualenv
ENV VIRTUAL_ENV=${APP_HOME}/.venv
ENV PATH=${APP_HOME}/.venv/bin:$PATH
ENV PATH=${APP_HOME}:$PATH
ENV TZ=Europe/Kiev
ENV LANG="en_US.UTF-8"
ENV LC_ALL="en_US.UTF-8"
ENV LC_LANG="en_US.UTF-8"
ENV PYTHONIOENCODING="UTF-8"
ENV PYTHONPATH "/app/src/:${PYTHONPATH}"
EXPOSE 80
CMD ["gunicorn", "--bind", "0.0.0.0:80", "-k", "gevent", "--paste", "/app/etc/service.ini", "--graceful-timeout=60", "--timeout=360"]