-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 743 Bytes
/
Dockerfile
File metadata and controls
29 lines (25 loc) · 743 Bytes
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
FROM node:18-alpine AS frontendbuilder
WORKDIR /app
COPY . .
RUN npm install -g pnpm
RUN cd /app && cd ui && pnpm install && CI=false pnpm build && cd ..
RUN cd /app && mkdir -p public
RUN cp -r ui/build/* public/
FROM golang:1.23-alpine AS binarybuilder
RUN apk --no-cache --no-progress add git
WORKDIR /app
COPY . .
COPY --from=frontendbuilder /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" ]