fix: Dockerfile
This commit is contained in:
parent
5860f81aa2
commit
ad77710ad1
32
Dockerfile
32
Dockerfile
|
@ -2,29 +2,27 @@ FROM golang:1.22 as builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the local package files to the container's workspace.
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
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
|
# Copy the project code into the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
FROM alpine:3.15
|
# Build the Go app
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -v -o git-webhook-ci
|
||||||
|
|
||||||
# Install ca-certificates, ffmpeg (which includes ffprobe), Python, and yt-dlp
|
# Use a small Alpine Linux image
|
||||||
RUN apk --no-cache add ca-certificates ffmpeg python3 py3-pip \
|
FROM alpine:latest
|
||||||
&& python3 -m venv /opt/venv \
|
|
||||||
&& source /opt/venv/bin/activate \
|
|
||||||
&& pip install --no-cache-dir yt-dlp
|
|
||||||
|
|
||||||
ENV PATH="/opt/venv/bin:$PATH"
|
# Set the working directory
|
||||||
|
WORKDIR /root/
|
||||||
|
|
||||||
COPY --from=builder /app/banana-byte /app/banana-byte
|
# Copy the binary from the builder stage
|
||||||
COPY --from=builder /app/web /app/web
|
COPY --from=builder /app/git-webhook-ci .
|
||||||
|
|
||||||
ENV VIEWS_DIR="/app/web"
|
# Document that the service listens on port 8080.
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
EXPOSE $PORT
|
# Run the binary.
|
||||||
|
CMD ["./git-webhook-ci"]
|
||||||
CMD ["/app/banana-byte"]
|
|
||||||
|
|
Loading…
Reference in New Issue