-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.42 KB
/
Dockerfile
File metadata and controls
49 lines (36 loc) · 1.42 KB
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
42
43
44
45
46
47
48
49
# Build stage
FROM golang:1.25-bookworm AS builder
WORKDIR /app
# Copy go mod files first for better caching
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -o lightcms ./cmd/server
# Runtime stage (Debian for Cloudflare WARP support)
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl gnupg dbus bash \
&& curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg \
| gpg --dearmor -o /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ bookworm main" \
> /etc/apt/sources.list.d/cloudflare-client.list \
&& apt-get update && apt-get install -y --no-install-recommends cloudflare-warp \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/lightcms .
# Copy static files and templates
COPY --from=builder /app/static ./static
COPY --from=builder /app/build.json ./build.json
COPY --from=builder /app/.well-known ./.well-known
# Copy startup script
COPY start.sh ./start.sh
RUN chmod +x start.sh
# Create directories for runtime data
RUN mkdir -p content/generated static/uploads
# Expose port
EXPOSE 8082
# Start WARP daemon + LightCMS
CMD ["./start.sh"]