-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 867 Bytes
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 867 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
40
41
42
43
FROM python:3.13-slim
########################################
# add a user so we're not running as root
########################################
RUN useradd sprintf
RUN apt-get update
RUN apt-get install -y curl
RUN apt-get clean
RUN mkdir -p /home/sprintf/
RUN chown sprintf /home/sprintf -R
RUN mkdir -p build/sprintf
WORKDIR /build
COPY sprintf sprintf
COPY pyproject.toml .
RUN chown sprintf:sprintf /build -R
RUN chown sprintf:sprintf /home/sprintf -R
WORKDIR /build/
USER sprintf
RUN python -m pip install --user --upgrade pip /build
# clean up after ourselves
USER root
WORKDIR /
RUN rm -rf /build/
USER sprintf
# to allow xff headers from docker IPs
ENV FORWARDED_ALLOW_IPS="*"
# tell people where we're running the thing
EXPOSE 8000
ENV PATH="/home/sprintf/.local/bin"
CMD [ "sprintf", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers"]