-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (34 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
39 lines (34 loc) · 1.18 KB
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
ARG TZ=Europe/Berlin
FROM node:lts-alpine AS build-frontend-stage
WORKDIR /app
ADD ./frontend .
ADD .env .
RUN npm install && npm run build
FROM node:lts-alpine AS build-swagger-stage
WORKDIR /app
ADD ./swagger .
ADD .env .
RUN npm install && npm run build
FROM golang:1.24-alpine AS build-backend-stage
RUN apk update && apk add --no-cache git ca-certificates tzdata && update-ca-certificates
WORKDIR /app
ADD ./backend .
# copy frontend
COPY --from=build-frontend-stage /app/dist /app/frontend/
COPY --from=build-swagger-stage /app/dist /app/swagger/
# pull in and verify dependencies
RUN go mod download && go mod verify
# production build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o rdf-store-backend .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o rdf-store-cli ./cli/main.go
FROM busybox:1.37
ARG TZ
COPY --from=build-backend-stage /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build-backend-stage /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
COPY --from=build-backend-stage /app/rdf-store-backend .
COPY --from=build-backend-stage /app/rdf-store-cli .
ENV TZ=$TZ
ENV PATH=$PATH:/app
EXPOSE 3000
CMD ["./rdf-store-backend"]