-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (27 loc) · 681 Bytes
/
Copy pathDockerfile
File metadata and controls
47 lines (27 loc) · 681 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM node:alpine AS frontend-build-stage
ENV VITE_API_URL=/api
WORKDIR /app
RUN corepack enable
COPY ui/package.json ui/pnpm-lock.yaml ./
RUN pnpm install
COPY ui/ .
RUN pnpm run build
FROM golang:alpine AS build-stage
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY main.go main.go
COPY cmd/ cmd/
COPY config/ config/
COPY internal/ internal/
COPY pkg/ pkg/
COPY --from=frontend-build-stage /app/dist/ internal/web/dist/
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /msnserver main.go
FROM scratch
WORKDIR /
ENV USER=msn
ENV GROUP=msn
COPY --from=build-stage /msnserver /msnserver
USER 65532:65532
EXPOSE 1863
ENTRYPOINT ["/msnserver"]