hcloud-pricing-exporter/Dockerfile

19 lines
372 B
Docker
Raw Permalink Normal View History

2021-03-05 15:35:21 +00:00
ARG ARCH=""
FROM golang:alpine
# Create application directory
RUN mkdir /app
ADD . /app/
WORKDIR /app
# Build the application
2021-03-05 19:28:59 +00:00
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go mod download
2021-03-05 15:35:21 +00:00
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -o run .
# Add the execution user
RUN adduser -S -D -H -h /app execuser
USER execuser
# Run the application
ENTRYPOINT ["./run"]