himbot/Dockerfile

26 lines
426 B
Text
Raw Permalink Normal View History

2024-11-04 11:41:29 -06:00
# Build stage
FROM golang:1.23.2 AS build
2024-05-15 10:02:42 -06:00
WORKDIR /app
2024-10-21 21:20:10 -06:00
COPY go.mod go.sum ./
2024-05-15 10:02:42 -06:00
RUN go mod download
2024-10-21 21:20:10 -06:00
COPY . .
2024-11-04 11:41:29 -06:00
RUN go build -ldflags="-s -w" -o /go/bin/app
2024-10-21 21:20:10 -06:00
2024-11-04 11:41:29 -06:00
# Final stage
FROM ubuntu:22.04
2024-10-21 22:12:57 -06:00
2024-11-04 11:41:29 -06:00
# Install SSL certificates and required runtime libraries
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
2024-05-15 10:02:42 -06:00
2024-10-21 21:20:10 -06:00
COPY --from=build /go/bin/app /app
2024-05-15 10:02:42 -06:00
2024-10-21 22:12:57 -06:00
# Set the entrypoint
2024-10-21 21:20:10 -06:00
ENTRYPOINT ["/app"]