File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM python:3.10-bookworm as builder
2
+
3
+ WORKDIR /builder
4
+
5
+ RUN addgroup --gid 1000 user
6
+ RUN adduser --disabled-password --gecos '' --uid 1000 --gid 1000 user
7
+
8
+ ENV USER=user
9
+ ENV HOME=/home/user
10
+
11
+ RUN python3 -mvenv venv && ./venv/bin/pip install --no-cache-dir --upgrade pip
12
+
13
+ COPY requirements.txt requirements.txt
14
+
15
+ RUN ./venv/bin/pip install -U --no-cache-dir -r requirements.txt
16
+
17
+ FROM python:3.10-bookworm as runner
18
+
19
+ WORKDIR /app
20
+
21
+ RUN addgroup --gid 1000 user
22
+ RUN adduser --disabled-password --gecos '' --uid 1000 --gid 1000 user
23
+
24
+ ENV USER=user
25
+ ENV HOME=/home/user
26
+
27
+ COPY --from=builder --chown=user:user /builder/venv /app/venv
28
+
29
+ COPY --chown=user:user app.py app.py
30
+
31
+ RUN chown -R user:user /app && chown -R user:user /home/user
32
+
33
+ USER user
34
+
35
+ ENV ENABLE_API_TOKEN=false
36
+ ENV API_TOKEN=
37
+ ENV APP_ENV=production
38
+ ENV LISTEN_HOST=0.0.0.0
39
+ ENV LISTEN_PORT=7860
40
+
41
+ EXPOSE $LISTEN_PORT
42
+
43
+ ENTRYPOINT [ "./venv/bin/python" , "app.py" ]
You can’t perform that action at this time.
0 commit comments