treasurer/Dockerfile

30 lines
620 B
Docker
Raw Normal View History

2023-06-13 13:22:51 +00:00
# BUILD
2025-01-02 22:25:37 +00:00
FROM gitea.pena/penadevops/container-images/golang:main as build
2023-06-13 13:22:51 +00:00
# Update depences
RUN apk update && apk add --no-cache curl
# Create build directory
RUN mkdir /app/bin -p
# Set home directory
WORKDIR /app
# Copy go.mod
ADD go.mod go.sum /app/
# Download go depences
RUN go mod download
# Copy all local files
ADD . /app
# Build app
RUN GOOS=linux go build -o bin ./...
# PRODUCTION
2025-01-02 22:25:37 +00:00
FROM gitea.pena/penadevops/container-images/alpine:main
2023-06-13 13:22:51 +00:00
# Install packages
RUN apk --no-cache add ca-certificates
# Create home directory
WORKDIR /app
# Copy build file
COPY --from=build /app/bin/app ./app
# CMD
CMD ["./app"]