Newer
Older
anime-fetcher / Dockerfile
frozendragon 4 hours ago 837 bytes version 1
FROM golang:1.25-alpine AS builder

# Set the working directory inside the container
WORKDIR /app

# Copy dependency files and download modules (leverages Docker caching)
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the application source code
COPY main.go main.go

# Build a statically linked binary (disabling CGO ensures it works in an empty scratch image)
RUN CGO_ENABLED=0 GOOS=linux go build -o /main .

# Stage 2: Final minimal runtime environment
FROM debian:bookworm-slim

RUN apt-get update && \
    apt-get install -y ffmpeg && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy the pre-compiled binary from the builder stage
COPY --from=builder /main /app/main

COPY /frontend /app/frontend

COPY /yt-dlp_linux /app/yt-dlp_linux

# Command to execute when the container starts
ENTRYPOINT ["/app/main"]