-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.Dockerfile
78 lines (59 loc) · 1.56 KB
/
dev.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
70
71
72
73
74
75
76
77
ARG UNAME=pi
ARG UID=1000
ARG GID=1000
ARG APP_VERSION="v0.0.0"
ARG APP_ARCH=arm64
# Stage: base-dev
FROM ghcr.io/vijaygill/wg-ui-plus:base-dev-${APP_ARCH} AS base-dev
ARG UNAME
ARG UID
ARG GID
ARG APP_VERSION
ARG APP_ARCH
# Stage: builder
FROM base-dev AS builder
ARG UNAME
ARG UID
ARG GID
ARG APP_VERSION
RUN mkdir -p /wg-ui-plus
COPY . /wg-ui-plus
RUN chown -R $UNAME:$UNAME /wg-ui-plus
RUN cd /wg-ui-plus/src/clientapp && npm install --force && ng build --configuration production --prerender=false --deploy-url="/" --base-href="/" --aot=true
ENV APP_VERSION=${APP_VERSION}
ENV IMAGE_STAGE=base-dev-builder
# Stage: dev
FROM base-dev AS dev
ARG UNAME
ARG UID
ARG GID
ARG APP_VERSION
RUN mkdir -p /app /data /config && chown $UID:$GID /app /data /config
VOLUME /app /data /config
ENV APP_VERSION=${APP_VERSION}
ENV IMAGE_STAGE=dev
USER $UNAME
WORKDIR /wg-ui-plus/src
# Stage: base-live
FROM ghcr.io/vijaygill/wg-ui-plus:base-live-${APP_ARCH} AS base-live
ARG UNAME
ARG UID
ARG GID
ARG APP_VERSION
# Stage: live
FROM base-live AS live
ARG UNAME
ARG UID
ARG GID
ARG APP_VERSION
RUN mkdir -p /app /app/scripts /data /config
COPY --from=builder /wg-ui-plus/src/clientapp/dist/wg-ui-plus/browser /app/clientapp
COPY --from=builder /wg-ui-plus/src/api_project/ /app/api_project
COPY --from=builder /wg-ui-plus/scripts/run-app.sh /app/scripts
COPY --from=builder /wg-ui-plus/scripts/monitor-*.sh /app/scripts
COPY --from=builder /wg-ui-plus/LICENSE /app
RUN chown -R $UID:$GID /app /data /config
VOLUME /data /config
WORKDIR /app
USER $UNAME
ENTRYPOINT [ "/app/scripts/run-app.sh" ]