discord-tweeter/Dockerfile
2023-08-29 18:00:00 +02:00

20 lines
567 B
Docker

FROM golang:1.21 AS build
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates
WORKDIR /tmp/app
COPY . .
RUN go mod download && \
CGO_ENABLED=1 go build -a -buildmode=pie -trimpath -ldflags "-s -w -linkmode 'external' -extldflags '-static-pie' -X main.prefix=" -o discord-tweeter
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
COPY --from=build /tmp/app/discord-tweeter .
#COPY ./config.example.toml ./config.toml
ENTRYPOINT [ "./discord-tweeter" ]
# CMD [ "./config.toml" ]