-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
65 lines (44 loc) · 1.81 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
ARG ARCH=amd64
ARG NODE_VERSION=current
FROM alpine:3.9.2 as qemu
RUN apk add --no-cache curl
ARG QEMU_VERSION=4.2.0-7
# https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN curl -fsSL https://github.com/multiarch/qemu-user-static/releases/download/v${QEMU_VERSION}/qemu-arm-static.tar.gz | tar zxvf - -C /usr/bin
RUN curl -fsSL https://github.com/multiarch/qemu-user-static/releases/download/v${QEMU_VERSION}/qemu-aarch64-static.tar.gz | tar zxvf - -C /usr/bin
RUN chmod +x /usr/bin/qemu-*
# ----------------------------------------------------------------------------
FROM ${ARCH}/node:${NODE_VERSION}-alpine as build
# copy qemu binaries used for cross-compiling
COPY --from=qemu /usr/bin/qemu-* /usr/bin/
RUN apk add --no-cache \
alpine-sdk \
curl \
drill \
git \
net-tools \
python
WORKDIR /app
COPY package.json ./
COPY source/ ./source
RUN yarn install --ignore-optional --production
# ----------------------------------------------------------------------------
FROM ${ARCH}/node:${NODE_VERSION}-alpine
ARG BUILD_DATE
ARG BUILD_VERSION
ARG VCS_REF
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="commonshost/dohnut"
LABEL org.label-schema.description="Dohnut is a DNS to DNS-over-HTTPS (DoH) proxy server"
LABEL org.label-schema.url="https://help.commons.host/dohnut/"
LABEL org.label-schema.vcs-url="https://github.com/commonshost/dohnut"
LABEL org.label-schema.docker.cmd="docker run -p 53:53/tcp -p 53:53/udp commonshost/dohnut --listen 0.0.0.0:53 --doh commonshost"
LABEL org.label-schema.build-date="${BUILD_DATE}"
LABEL org.label-schema.version="${BUILD_VERSION}"
LABEL org.label-schema.vcs-ref="${VCS_REF}"
WORKDIR /etc/dohnut
VOLUME /etc/dohnut
ENV NODE_ENV production
COPY --from=build /app /app
ENTRYPOINT [ "node", "/app/source/bin.js" ]