forked from Roverr/rtsp-stream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.management
28 lines (26 loc) · 1011 Bytes
/
Dockerfile.management
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
## Build server
FROM golang:1.13-alpine AS build-backend
ADD ./main.go /go/src/github.com/Roverr/rtsp-stream/main.go
ADD ./core /go/src/github.com/Roverr/rtsp-stream/core
ADD ./Gopkg.toml /go/src/github.com/Roverr/rtsp-stream/Gopkg.toml
WORKDIR /go/src/github.com/Roverr/rtsp-stream
RUN apk add --update --no-cache git
RUN go get -u github.com/golang/dep/cmd/dep
RUN dep ensure -v
RUN go build -o server
## Build UI
FROM node:lts-slim as build-ui
ADD ./ui /tmp/ui
WORKDIR /tmp/ui
RUN npm install
RUN echo API_URL=http://127.0.0.1:8080 > ./src/.env
RUN npm run build
## Creating potential production image
FROM woahbase/alpine-supervisor:x86_64
RUN apk update && apk add bash ca-certificates ffmpeg nodejs npm && rm -rf /var/cache/apk/*
RUN npm install http-server -g
COPY ./build/management/supervisord.conf /etc/supervisord.conf
WORKDIR /app
COPY --from=build-backend /go/src/github.com/Roverr/rtsp-stream/server /app/
COPY ./build/rtsp-stream.yml /app/rtsp-stream.yml
COPY --from=build-ui /tmp/ui/dist /ui/