-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (31 loc) · 861 Bytes
/
Dockerfile
File metadata and controls
44 lines (31 loc) · 861 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
42
43
44
# Build stage
FROM golang:1.25.5-alpine AS builder
# Install required tools for building
RUN apk add --no-cache git make protoc protobuf-dev
# Set working directory
WORKDIR /build
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY internal internal
COPY pkg pkg
COPY cmd cmd
COPY svctl svctl
COPY main.go main.go
COPY Makefile ./
# Generate code and build the daemon
RUN make build-linux
# Runtime stage
FROM alpine:3.21
# Install ca-certificates for HTTPS requests and Docker CLI for Docker game servers
RUN apk add ca-certificates docker-cli
# Copy binary from build stage
COPY --from=builder /build/bin/svctl /usr/local/bin/svctl
# Set working directory
WORKDIR /app
# Expose default daemon port
EXPOSE 9090
# Default command to run daemon
ENTRYPOINT ["/usr/local/bin/svctl", "daemon"]