codeword/Dockerfile

28 lines
581 B
Docker
Raw Normal View History

2024-01-18 01:42:26 +00:00
# BUILD
2025-01-04 13:35:42 +00:00
FROM gitea.pena/penadevops/container-images/golang:main as build
2024-01-18 01:42:26 +00:00
# Update packages and clear cache
RUN apk add --no-cache curl
# Set work directory
WORKDIR /app
# Create binary directory
RUN mkdir /app/bin -p
# Add main files to app
2024-08-29 21:26:44 +00:00
RUN apk add git
2024-01-18 01:42:26 +00:00
ADD . .
2024-08-29 21:26:44 +00:00
RUN go mod download
2024-01-18 01:42:26 +00:00
# Build app
RUN GOOS=linux go build -o bin ./...
# PRODUCTION
2025-01-04 13:35:42 +00:00
FROM gitea.pena/penadevops/container-images/alpine:main
2024-01-18 01:42:26 +00:00
# Install packages
RUN apk --no-cache add ca-certificates
# Create home directory
WORKDIR /app
# Copy build file
COPY --from=build /app/bin/codeword ./app
# CMD
CMD ["./app"]