forked from DiffuseHyperion/outline-vpn-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (45 loc) · 1.69 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
FROM golang:alpine AS build-go
WORKDIR /setup/
COPY /go.mod /
COPY /go.sum /
RUN go build github.com/go-task/task/v3/cmd/task
RUN CGO_ENABLED=0 go build -ldflags='-s -w -X main.version=embedded' github.com/Jigsaw-Code/outline-ss-server/cmd/outline-ss-server
FROM node:18.18.0-alpine3.18 AS build-node
COPY --from=build-go /setup/task /usr/local/bin/
WORKDIR /setup/
COPY . /
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN apk add --no-cache --upgrade chromium
RUN npm install
RUN task shadowbox:build TARGET_DIR=/setup/build/
COPY --from=build-go /setup/outline-ss-server /setup/build/bin/
# https://github.com/Jigsaw-Code/outline-server/blob/master/src/shadowbox/Taskfile.yml#L64
FROM node:18.18.0-alpine3.18 AS deploy
# https://github.com/puppeteer/puppeteer/issues/7740
ENV SB_STATE_DIR=/shadowbox/state
ENV SB_API_PREFIX=api
ENV SB_CERTIFICATE_FILE=/shadowbox/state/shadowbox-selfsigned.crt
ENV SB_PRIVATE_KEY_FILE=/shadowbox/state/shadowbox-selfsigned.key
VOLUME ${SB_STATE_DIR}
# Default API port
EXPOSE 8081
# Access key port
EXPOSE 8082
EXPOSE 8082/udp
STOPSIGNAL SIGKILL
RUN apk add --no-cache --upgrade coreutils curl openssl jq
COPY app /app
RUN mkdir -p /etc/periodic/weekly/
COPY /src/shadowbox/scripts/update_mmdb.sh /etc/periodic/weekly/update_mmdb.sh
RUN chmod +x /etc/periodic/weekly/update_mmdb.sh
RUN /etc/periodic/weekly/update_mmdb.sh
RUN mkdir /shadowbox/
RUN mkdir /shadowbox/app/
RUN mkdir /shadowbox/bin/
RUN mkdir -p ${SB_STATE_DIR}
COPY --from=build-node /setup/build/app/ /shadowbox/app/
COPY --from=build-node /setup/build/bin/ /shadowbox/bin/
COPY /docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
WORKDIR /shadowbox/
ENTRYPOINT /docker-entrypoint.sh