Files
stufflog3/Dockerfile
T
gisle f57149c0d0
continuous-integration/drone/push Build is failing
un-SSR this b→þ©ħ
2022-10-02 11:37:26 +02:00

25 lines
649 B
Docker

## 1. Build Server
# Use Go 1.18
FROM golang:1.18 AS build-server
# Load repository into docker
WORKDIR /project/
COPY . .
# Build server and tools (CGO disabled to make them 100% static)
ENV CGO_ENABLED 0
RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/stufflog3 ./cmd/stufflog3
## 2. Distribute
# Use alpine linux
FROM alpine:3.16
# Install certificates to enable HTTPS GET requests, and tzdata for log imports.
RUN apk add --no-cache ca-certificates tzdata
# Copy build files into final container
COPY --from=build-server /binaries/* /usr/local/bin/
# The server is the main entry point
CMD ["/usr/local/bin/stufflog3-local"]