-
-
Notifications
You must be signed in to change notification settings - Fork 649
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (65 loc) · 1.8 KB
/
Copy pathDockerfile
File metadata and controls
75 lines (65 loc) · 1.8 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Install npm packages
FROM node:10.17.0-alpine AS npm
WORKDIR /code
COPY ./static/package*.json /code/static/
RUN cd /code/static && npm ci
FROM ubuntu:24.04
ARG TARGETARCH
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
WORKDIR /code
# Copy dependency files
COPY pyproject.toml uv.lock .python-version ./
# Install deps
RUN \
echo "**** install build packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
curl \
netcat-traditional \
gcc \
python3-dev \
gnupg \
git \
libre2-dev \
build-essential \
pkg-config \
cmake \
ninja-build \
bash \
clang \
ca-certificates && \
curl -o /tmp/uv-installer.sh -L https://astral.sh/uv/install.sh && \
sh /tmp/uv-installer.sh && \
export PATH="$HOME/.local/bin:$PATH" && \
uv python install `cat .python-version` && \
export CMAKE_POLICY_VERSION_MINIMUM=3.5 && \
uv sync --no-dev --no-cache && \
echo "**** install runtime packages ****" && \
apt-get install -y \
gnupg \
libre2-10 && \
echo "**** cleanup ****" && \
apt-get purge -y \
curl \
netcat-traditional \
build-essential \
pkg-config \
cmake \
ninja-build \
python3-dev \
clang && \
apt-get autoremove -y && \
apt-get autoclean -y && \
rm -rf \
/var/lib/apt/lists/*
# Copy code
COPY . .
# copy npm packages
COPY --from=npm /code /code
ENV PATH="/code/.venv/bin:$PATH"
EXPOSE 7777
#gunicorn wsgi:app -b 0.0.0.0:7777 -w 2 --timeout 15 --log-level DEBUG
CMD ["gunicorn","wsgi:app","-b","0.0.0.0:7777","-w","2","--timeout","15"]