-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 894 Bytes
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Multi-stage build for minimal image size
# Builds for the current system (native compilation - no cross-compilation)
FROM golang:1.21-bookworm AS builder
WORKDIR /app
# Copy go mod files and download deps
COPY go.mod go.sum ./
RUN go mod download
# Copy source
COPY *.go ./
# Build binary for current system
RUN go build -ldflags="-s" -o dash-of-pi .
# Runtime image
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
ca-certificates \
fonts-dejavu-core \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/dash-of-pi .
# Copy web assets
COPY web/ ./web/
# Create directories and expose port
RUN mkdir -p /var/lib/dash-of-pi/videos /etc/dash-of-pi
EXPOSE 8080
ENTRYPOINT ["/app/dash-of-pi"]
CMD ["-config", "/etc/dash-of-pi/config.json"]