git-webhook-ci/Dockerfile

31 lines
684 B
Docker

FROM golang:1.22 as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY internal ./internal
COPY pk ./pk
ARG PORT
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/webhook-ci /app/main.go
FROM alpine:3.15
# Install ca-certificates, ffmpeg (which includes ffprobe), Python, and yt-dlp
RUN apk --no-cache add ca-certificates ffmpeg python3 py3-pip \
&& python3 -m venv /opt/venv \
&& source /opt/venv/bin/activate \
&& pip install --no-cache-dir yt-dlp
ENV PATH="/opt/venv/bin:$PATH"
COPY --from=builder /app/banana-byte /app/banana-byte
COPY --from=builder /app/web /app/web
ENV VIEWS_DIR="/app/web"
EXPOSE $PORT
CMD ["/app/banana-byte"]