forked from deepch/RTSPtoWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (19 loc) · 644 Bytes
/
Dockerfile
File metadata and controls
30 lines (19 loc) · 644 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
# syntax=docker/dockerfile:1
FROM --platform=${BUILDPLATFORM} golang:1.18rc1-alpine3.15 AS builder
RUN apk add git
WORKDIR /go/src/app
COPY . .
ARG TARGETOS TARGETARCH TARGETVARIANT
ENV CGO_ENABLED=0
RUN go get \
&& go mod download \
&& GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=${TARGETVARIANT#"v"} go build -a -o rtsp-to-web
FROM alpine:3.15
WORKDIR /app
COPY --from=builder /go/src/app/rtsp-to-web /app/
COPY --from=builder /go/src/app/web /app/web
RUN mkdir -p /config
COPY --from=builder /go/src/app/config.json /config
ENV GO111MODULE="on"
ENV GIN_MODE="release"
CMD ["./rtsp-to-web", "--config=/config/config.json"]