2024-01-18 01:42:26 +00:00
|
|
|
# BUILD
|
2024-06-11 15:55:53 +00:00
|
|
|
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/golang 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
|
|
|
|
ADD . .
|
|
|
|
# Build app
|
|
|
|
RUN GOOS=linux go build -o bin ./...
|
|
|
|
|
|
|
|
# PRODUCTION
|
2024-06-11 15:55:53 +00:00
|
|
|
FROM penahub.gitlab.yandexcloud.net:5050/devops/dockerhub-backup/alpine AS production
|
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"]
|