37 lines
840 B
Text
37 lines
840 B
Text
|
|
## Stage 1: Build go-transcode
|
||
|
|
FROM golang:1.23-alpine AS build-transcode
|
||
|
|
RUN apk add --no-cache git
|
||
|
|
WORKDIR /src
|
||
|
|
COPY go-transcode/ ./
|
||
|
|
RUN if [ -f go.mod ]; then go build -o /go-transcode .; fi
|
||
|
|
|
||
|
|
## Stage 2: Build sheepflix-api
|
||
|
|
FROM golang:1.23-alpine AS build-api
|
||
|
|
WORKDIR /src
|
||
|
|
COPY go.mod go.sum ./
|
||
|
|
RUN go mod download
|
||
|
|
COPY cmd/ cmd/
|
||
|
|
COPY internal/ internal/
|
||
|
|
RUN CGO_ENABLED=0 go build -o /sheepflix-api ./cmd/sheepflix
|
||
|
|
|
||
|
|
## Stage 3: Runtime
|
||
|
|
FROM alpine:3.20
|
||
|
|
|
||
|
|
RUN apk add --no-cache \
|
||
|
|
ffmpeg \
|
||
|
|
libva \
|
||
|
|
libva-intel-driver \
|
||
|
|
intel-media-driver \
|
||
|
|
mesa-va-gallium \
|
||
|
|
bash
|
||
|
|
|
||
|
|
COPY --from=build-api /sheepflix-api /usr/local/bin/sheepflix-api
|
||
|
|
COPY --from=build-transcode /go-transcode /usr/local/bin/go-transcode
|
||
|
|
|
||
|
|
COPY entrypoint.sh /entrypoint.sh
|
||
|
|
RUN chmod +x /entrypoint.sh
|
||
|
|
|
||
|
|
EXPOSE 8090 8091
|
||
|
|
|
||
|
|
ENTRYPOINT ["/entrypoint.sh"]
|