-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (26 loc) · 773 Bytes
/
Dockerfile
File metadata and controls
29 lines (26 loc) · 773 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 golang:1.24-alpine AS backend-builder
WORKDIR /app
COPY backend-go/go.mod backend-go/go.sum ./
RUN go mod download && \
go mod verify
COPY backend-go/main.go .
COPY backend-go/internal ./internal
RUN CGO_ENABLED=0 GOOS=linux go build -o main
FROM node:22-alpine AS frontend-builder
WORKDIR /app
COPY frontend/package.json frontend/yarn.lock ./
RUN yarn install
COPY frontend/ ./
RUN yarn run build
FROM alpine/git:latest AS git-tag
WORKDIR /app
COPY .git ./.git
RUN git describe --tags --always > .git-tag
FROM alpine:3.22
COPY --from=backend-builder /app/main /app/backend-go/main
COPY --from=frontend-builder /app/dist /app/frontend/dist
COPY --from=git-tag /app/.git-tag /app/.git-tag
WORKDIR /app/backend-go
ENV GIN_MODE=release
ENV PORT=8080
CMD ["./main"]