-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (27 loc) · 726 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (27 loc) · 726 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
FROM node:20-alpine as web
WORKDIR /app
COPY frontend/package.json /app/package.json
COPY frontend/yarn.lock /app/yarn.lock
RUN yarn install
COPY frontend /app
RUN yarn build
FROM golang:latest as builder
WORKDIR /app
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
# src code
COPY . .
COPY --from=web /app/dist /app/backend/web
# env
ENV GOOS=linux
ENV CGO_ENABLED=0
ENV GIN_MODE=release
# build
RUN go build -tags netgo -o vortexnotes
FROM alpine:latest
COPY --from=builder /app/vortexnotes /app/vortexnotes
EXPOSE 10060
CMD ["/app/vortexnotes"]