-
Notifications
You must be signed in to change notification settings - Fork 32
/
DockerfileNode-16
46 lines (26 loc) · 948 Bytes
/
DockerfileNode-16
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
# Build frontend dist.
FROM node:18-alpine AS frontend
WORKDIR /frontend-build
COPY ./ui .
RUN yarn config set registry https://registry.npmmirror.com
RUN yarn && yarn build
# Build backend exec file.
FROM golang:1.21-alpine AS backend
WORKDIR /backend-build
COPY . .
RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go build -o main ./marewood.go
FROM node:16-alpine AS marewood
WORKDIR /marewood
RUN npm config set registry https://registry.npmmirror.com
RUN yarn config set registry https://registry.npmmirror.com
#(node16)
RUN npm install -g pnpm@7 && npm cache clean --force
RUN pnpm config set registry https://registry.npmmirror.com
RUN apk add git
COPY --from=backend /backend-build/main /marewood/main
COPY --from=frontend /frontend-build/dist /marewood/ui/dist
EXPOSE 8088
VOLUME /marewood/resources
ENTRYPOINT ["/marewood/main"]
#sudo docker build -t ghcr.io/xusenlin/marewood:1.0.3-node16 . -f DockerfileNode-16