-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile
41 lines (25 loc) · 872 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
35
36
37
38
39
40
41
# 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:22-alpine AS marewood
WORKDIR /marewood
#(node > 18)
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN npm config set registry https://registry.npmmirror.com
RUN yarn config set registry https://registry.npmmirror.com
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"]