-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 651 Bytes
/
Dockerfile
File metadata and controls
37 lines (25 loc) · 651 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
31
32
33
34
35
36
37
# golang image
FROM golang:latest AS build
# set work dir
WORKDIR /app
# copy go module files and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# copy the source files
COPY . .
# disable crosscompiling
ENV CGO_ENABLED=0
# compile linux only
ENV GOOS=linux
# build the binary with debug information removed
RUN cd ./server && go build -ldflags '-w -s' -a -installsuffix cgo -o server
FROM jrottenberg/ffmpeg:8-alpine
# set work dir
WORKDIR /app
# copy our static linked library
COPY --from=build /app/server/server .
# tell we are exposing our service ports
EXPOSE 50051 8080 8081
ENTRYPOINT []
# run it!
CMD ["./server"]