-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
55 lines (39 loc) · 927 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
48
49
50
51
52
53
54
55
# Backend build
FROM golang:1.22 AS go-build-env
WORKDIR /app
# <- COPY go.mod and go.sum files to the workspace
COPY go.mod .
COPY go.sum .
RUN go mod download
# COPY the source code as the last step
COPY api ./api
COPY .git /.git
WORKDIR /app/api
# Build the Go app
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o /helix
# Frontend build
FROM node:21-alpine AS ui-build-env
WORKDIR /app
RUN echo "installing apk packages" && \
apk update && \
apk upgrade && \
apk add \
bash \
git \
curl \
openssh
# root config
COPY ./frontend/*.json /app/
COPY ./frontend/yarn.lock /app/yarn.lock
# Install modules
RUN yarn install
# Copy the rest of the code
COPY ./frontend /app
# Build the frontend
RUN yarn build
FROM alpine:3.17
RUN apk --update add ca-certificates
COPY --from=go-build-env /helix /helix
COPY --from=ui-build-env /app/dist /www
ENV FRONTEND_URL=/www
ENTRYPOINT ["/helix", "serve"]