-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
FROM golang:1.17-bullseye | ||
|
||
WORKDIR /app | ||
|
||
# | ||
# install dependencies | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN set -eux; apt update; \ | ||
apt install -y --no-install-recommends ffmpeg; \ | ||
# | ||
# clean up | ||
apt clean -y; \ | ||
rm -rf /var/lib/apt/lists/* /var/cache/apt/* | ||
# STAGE 1: build executable binary | ||
# | ||
FROM golang:1.17-alpine as builder | ||
WORKDIR /app | ||
|
||
# | ||
# build server | ||
COPY . . | ||
|
||
RUN go get -v -t -d .; \ | ||
go build -o bin/go-transcode | ||
CGO_ENABLED=0 go build -o go-transcode | ||
|
||
# | ||
# STAGE 2: build a small image | ||
# | ||
FROM alpine | ||
WORKDIR /app | ||
|
||
# | ||
# install dependencies | ||
RUN apk add --no-cache bash ffmpeg | ||
|
||
COPY --from=builder /app/go-transcode go-transcode | ||
COPY profiles profiles | ||
|
||
EXPOSE 8080 | ||
ENV TRANSCODE_BIND=:8080 | ||
|
||
ENTRYPOINT [ "bin/go-transcode" ] | ||
ENTRYPOINT [ "./go-transcode" ] | ||
CMD [ "serve" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters