-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
47 lines (28 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
42
43
44
45
46
47
# SPDX-FileCopyrightText: 2023 Steffen Vogel <[email protected]>
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.23-alpine AS backend-builder
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -o gose ./cmd
FROM node:22 AS frontend-builder
WORKDIR /app
COPY frontend/package.json .
COPY frontend/package-lock.json* .
RUN npm install
COPY frontend/ .
ENV NODE_ENV=production
RUN npm run build
FROM alpine:3.21
RUN apk update && apk add ca-certificates curl && rm -rf /var/cache/apk/*
COPY --from=frontend-builder /app/dist/ /dist/
COPY --from=backend-builder /app/gose /
COPY --from=backend-builder /app/config.yaml /
ENV GIN_MODE=release
ENV GOSE_SERVER_STATIC=/dist
EXPOSE 8080/tcp
HEALTHCHECK --interval=30s --timeout=30s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/healthz
ENTRYPOINT [ "/gose" ]