Spaces:
Paused
Paused
Create Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435# 1. Build Stage (Compiles the Go app)FROM golang:1.23-bookworm AS builder
WORKDIR /app
# Copy files and buildCOPY go.mod go.sum ./RUN go mod downloadCOPY . .RUN go build -o media-app main.go
# ---------------------------------------------------------
# 2. Runtime Stage (The actual server)FROM debian:bookworm-slim
WORKDIR /app
# Enable 'non-free' repos to get the real 'unrar' and install dependencies# We use sed to add "non-free" to the apt sourcesRUN sed -i 's/main/main contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources && \ apt-get update && \ apt-get install -y ffmpeg unrar ca-certificates && \ rm -rf /var/lib/apt/lists/*
# Copy the binary and templates from the builderCOPY --from=builder /app/media-app .COPY --from=builder /app/templates ./templates
# Create foldersRUN mkdir -p downloads output
# Run itEXPOSE 8080CMD ["./media-app"]DockerfileAdded+35