Files
dance-lessons-coach/Dockerfile.build
Gabriel Radureau 816e1b7bc8
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Has been cancelled
CI/CD Pipeline / Build Docker Cache (push) Has been cancelled
feat: implement Docker build cache for CI acceleration
2026-04-07 08:31:24 +02:00

39 lines
987 B
Docker

# Build environment Dockerfile with pre-installed Go tools and dependencies
# Optimized for CI/CD pipeline speed
FROM golang:1.26.1-alpine AS builder
# Install build dependencies
RUN apk add --no-cache \
git \
bash \
curl \
make \
gcc \
musl-dev \
bc \
grep \
sed \
jq \
ca-certificates
# Set up Go environment
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin
WORKDIR /go/src/dance-lessons-coach
# Install common Go tools
RUN go install github.com/swaggo/swag/cmd/swag@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install honnef.co/go/tools/cmd/staticcheck@latest
# Copy only go.mod and go.sum first for dependency caching
COPY go.mod go.sum ./
RUN go mod download && go mod verify
# Copy the rest of the source (this happens in CI)
# COPY . .
# Build command (will be run in CI)
# RUN go build -o /out/server ./cmd/server && \
# go build -o /out/greet ./cmd/greet