forked from coroot/coroot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 691 Bytes
/
Dockerfile
File metadata and controls
30 lines (23 loc) · 691 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
30
FROM golang:1.18-stretch AS backend-builder
WORKDIR /tmp/src
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
ARG VERSION=unknown
RUN go test ./...
RUN go install -mod=readonly -ldflags "-X main.version=$VERSION" .
FROM node:18-buster AS frontend-builder
WORKDIR /tmp/src
COPY ./front/package*.json ./
RUN npm install
COPY ./front .
RUN npx vue-cli-service build --dest=static src/main.js
FROM debian:stretch
RUN apt update && apt install -y ca-certificates && apt clean
WORKDIR /opt/coroot
COPY --from=backend-builder /go/bin/coroot /opt/coroot/coroot
COPY --from=frontend-builder /tmp/src/static /opt/coroot/static
VOLUME /data
EXPOSE 8080
ENTRYPOINT ["/opt/coroot/coroot"]