# Use the official Golang image to create a build artifact.
FROM golang:1.25

# Set the Current Working Directory inside the container
WORKDIR /app

# Copy go mod and sum files
COPY go.mod go.sum ./
#COPY .env ./
COPY describegraph.json /app/describegraph.json

# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod tidy

# Copy the source from the current directory to the Working Directory inside the container
COPY . .

# Build the Go app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o lnstream .

# Command to run the executable
CMD ["./lnstream"]