-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 801 Bytes
/
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
#------ Source
FROM alpine/git as source
ARG REF=HEAD
ARG SRCDIR=/src
RUN git clone --no-checkout https://github.com/mikeperry-tor/vanguards ${SRCDIR}
RUN git -C ${SRCDIR} checkout ${REF}
RUN git -C ${SRCDIR} describe --tags > /version
WORKDIR ${SRCDIR}
#------ Base
FROM debian:buster-slim as base
ARG PYPYVER=pypy3.9-v7.3.9
RUN apt-get update
RUN apt-get install -y wget bzip2
COPY install-pypy.sh /.
RUN bash -x /install-pypy.sh || apt-get install -y python3 python3-pip
ENV PATH /opt/pypy/bin:$PATH
#------ Installer
FROM base as installer
ARG SRCDIR=/src
COPY --from=source ${SRCDIR} ${SRCDIR}
WORKDIR ${SRCDIR}
RUN python3 -m pip install .
#------ Runner
FROM base as runner
COPY --from=installer /opt /opt
COPY --from=source /version /version
ENTRYPOINT ["/opt/pypy/bin/vanguards"]