-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
35 lines (24 loc) · 722 Bytes
/
Dockerfile
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
# Build stage
FROM golang:1.22-alpine AS builder
# Set the working directory inside the container
WORKDIR /app
# Copy go.mod and go.sum files to download dependencies
COPY go.mod go.sum ./
# Download the dependencies
RUN go mod download && go mod verify
# Copy the rest of the source code
COPY . .
# Build the Go application
RUN CGO_ENABLED=0 GOOS=linux go build -o lunarr ./cmd
# Final stage
FROM alpine:latest
# Set the working directory inside the container
WORKDIR /app
# Copy the binary from the builder stage
COPY --from=builder /app/lunarr .
# Copy the configuration file
COPY lunarr.yml .
# Expose the port
EXPOSE 8484
# Run the application (no command-line args needed, uses env vars)
CMD ["./lunarr"]