Add Gin framework and create REST API endpoints
Some checks failed
Release Build / release (push) Successful in 1m37s
Release Build / create-docker-image (push) Failing after 51s
Release Build / create-release (push) Has been skipped

This commit is contained in:
2025-07-27 14:42:45 +06:00
parent ee68d72fcd
commit 381eefa47b
5 changed files with 223 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.21-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS builder
# Install git and ca-certificates
RUN apk --no-cache add git ca-certificates
@@ -15,8 +15,13 @@ RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o hello-api main.go
# Build the application for target platform
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -installsuffix cgo -o hello-api main.go
# Final stage
FROM alpine:latest