-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
32 lines (22 loc) · 681 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
# Build stage
FROM golang:1.20-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
# 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 .
# Expose the port
EXPOSE 3000
# Run the application with the specified host and port
CMD ["./lunarr", "-host", "0.0.0.0", "-port", "3000"]