-
Notifications
You must be signed in to change notification settings - Fork 90
/
Dockerfile
34 lines (28 loc) · 930 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
FROM node:18-alpine AS feBuilder
WORKDIR /app
# RUN apk add --no-cache g++ gcc make python3
COPY . .
RUN cd /app && cd ui/admin && yarn install && yarn build && cd ../..
RUN cd ui/website && yarn install && yarn build && cd ../..
RUN cd /app && mkdir -p public/admin
RUN cp -r ui/website/build/* public/
RUN cp -r ui/admin/dist/* public/admin/
RUN sed -i 's/\/assets/\/admin\/assets/g' public/admin/index.html
FROM golang:alpine AS binarybuilder
RUN apk --no-cache --no-progress add git
WORKDIR /app
COPY . .
COPY --from=feBuilder /app/public /app/public
RUN cd /app && ls -la && go mod tidy && go build .
FROM alpine:latest
ENV TZ="Asia/Shanghai"
RUN apk --no-cache --no-progress add \
ca-certificates \
tzdata && \
cp "/usr/share/zoneinfo/$TZ" /etc/localtime && \
echo "$TZ" > /etc/timezone
WORKDIR /app
COPY --from=binarybuilder /app/nav /app/
VOLUME ["/app/data"]
EXPOSE 6412
ENTRYPOINT [ "/app/nav" ]