forked from darkwire/darkwire.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (27 loc) · 1.03 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
# builder: Builder For Darkwore
FROM --platform=$BUILDPLATFORM node:current-alpine AS builder
# Client configuration will be put into client/.env
ENV TZ=UTC \
VITE_COMMIT_SHA=terra-firma
WORKDIR /opt/app
COPY . .
RUN npm install -g yarn@latest --force \
&& yarn install --flat --production --no-cache \
&& yarn build --no-cache \
&& rm -rf /opt/app/node_modules \
&& yarn cache clean \
&& yarn autoclean --force
# final: Final Darkwire Image
FROM alpine:latest
WORKDIR /opt/app
RUN apk add --no-cache nginx yarn openssl iptables
COPY --from=builder /opt/app/client/dist /opt/app/client/dist
COPY --from=builder /opt/app/server /opt/app/server
COPY package.json /opt/app/package.json
COPY default.conf /etc/nginx/http.d/
COPY start.sh /opt/app/start.sh
RUN chmod +x /opt/app/start.sh
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD \
sh -c 'pgrep nginx > /dev/null && pgrep node > /dev/null' || exit 1
CMD ["/opt/app/start.sh", "start" ]
STOPSIGNAL SIGTERM