-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (25 loc) · 951 Bytes
/
Dockerfile
File metadata and controls
41 lines (25 loc) · 951 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
# Build stage
FROM golang:alpine AS builder
# Allow Go to download the required toolchain version
ENV GOTOOLCHAIN=auto
# Required for direct VCS module resolution fallback.
RUN apk add --no-cache git
WORKDIR /build
# Copy go module files
COPY go.mod go.sum ./
# Download Go dependencies
RUN go mod download
# Copy source code
COPY . .
# Build the application (pure Go, no CGO needed for modernc.org/sqlite)
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /audplexus ./cmd/server
# Runtime stage
FROM alpine:3.19
RUN apk add --no-cache ffmpeg ca-certificates tzdata su-exec
COPY --from=builder /audplexus /usr/local/bin/audplexus
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN mkdir -p /config /audiobooks /downloads
EXPOSE 8080
VOLUME ["/config", "/audiobooks", "/downloads"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]