mirror of
https://github.com/jangraefen/hcloud-pricing-exporter
synced 2024-11-13 23:37:10 +00:00
18 lines
372 B
Docker
18 lines
372 B
Docker
ARG ARCH=""
|
|
FROM golang:alpine
|
|
|
|
# Create application directory
|
|
RUN mkdir /app
|
|
ADD . /app/
|
|
WORKDIR /app
|
|
|
|
# Build the application
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go mod download
|
|
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"]
|