-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
69 lines (44 loc) · 1.66 KB
/
Dockerfile
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
# FROM docker.io/python:3-slim as python
FROM ghcr.io/white-gecko/python-libgit2:pygit2-main as python
ENV PYTHONUNBUFFERED=true
WORKDIR /app
RUN apt-get update && \
apt-get -y install \
libssh-4 \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -md /usr/src/app quit
WORKDIR /usr/src/app
FROM python as builder
RUN apt-get update && \
apt-get -y install \
git \
gcc \
libffi-dev \
libssh-dev \
python3-dev \
libssl-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=dist quit-*.whl .
RUN pip install --progress-bar=off quit-*.whl
RUN ln -s $( python -c "import site; print(site.getsitepackages()[0])" ) /usr/local/python-site-packages
USER quit
# Set default git user
RUN git config --global user.name QuitStore && git config --global user.email [email protected]
FROM python as runtime
LABEL org.opencontainers.image.title="Quit Store" \
org.opencontainers.image.authors="Norman Radtke <[email protected]>, Natanael Arndt <[email protected]>" \
org.opencontainers.image.source="https://github.com/AKSW/QuitStore/"
RUN ln -s $( python -c "import site; print(site.getsitepackages()[0])" ) /usr/local/python-site-packages
COPY --from=builder /usr/local/python-site-packages /usr/local/python-site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY --from=builder /usr/src/app/.gitconfig .
RUN mkdir /data && chown quit /data
COPY quit/ /usr/src/app/quit
USER quit
ENV PATH="/usr/src/app/.local/bin:${PATH}"
ENV SSH_AUTH_SOCK="/var/run/ssh-agent.sock"
VOLUME /data
VOLUME /etc/quit
EXPOSE 8080
CMD uwsgi --http 0.0.0.0:8080 -w quit.run -b 40960 --pyargv "-vv -t /data"