-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (28 loc) · 988 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
FROM node:21-alpine AS frontend
WORKDIR /build
COPY discover-frontend/package*.json ./
RUN npm i -g npm
RUN npm install --silent
COPY discover-frontend/ .
ENV PUBLIC_WRITE_FOOTER=true
ENV PUBLIC_API_ENDPOINT=/api/v1
RUN touch .env
RUN printenv > .env
RUN npm run build
FROM golang:1.19-alpine as backend
WORKDIR /build/src/server
RUN apk update && apk add git gcc musl-dev ca-certificates
COPY egh-api/go.mod ./
COPY egh-api/go.sum ./
ENV GO111MODULE=on
RUN go mod download
COPY egh-api/ ./
RUN CGO_ENABLED=0 GOOS=linux go build -o=server -buildvcs=false ./cmd/server
FROM ubuntu:20.04
WORKDIR /app
COPY --from=frontend /build/frontend /app/frontend/
COPY --from=backend /build/src/server/server /app/cmd/server/
COPY --from=backend /build/src/server/swagger /app/swagger/
COPY --from=backend /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
EXPOSE 8080
ENTRYPOINT [ "/app/cmd/server/server", "--store", "mem" ]