-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 829 Bytes
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 829 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
# --- Stage 1: Builder ---
# We use the official Go image to compile the code
FROM golang:1.25 AS builder
# Set the working directory inside the container
WORKDIR /app
# Copy all your source code into the container
COPY . .
# Disable CGO to ensure the binary runs on Alpine Linux
ENV CGO_ENABLED=0
# Build the binary
# We target main.go
RUN go build -o plgm cmd/plgm/main.go
# --- Stage 2: Runner ---
# We use a tiny Alpine Linux image for the final container
FROM alpine:latest
WORKDIR /app
# Copy the compiled binary from the builder stage
COPY --from=builder /app/plgm .
# Copy the config file so the app can read it
COPY config.yaml .
# Also copy the resources folder so we have access to all queries/collections
COPY resources/ resources/
# Command to run when the container starts
CMD ["./plgm", "config.yaml"]