Files
dance-lessons-coach/docker/Dockerfile.build
Gabriel Radureau e27ed5b6ca
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 52s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m22s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
🐛 fix: Move WORKDIR before COPY in Dockerfile.build
2026-04-09 12:19:40 +02:00

43 lines
1.1 KiB
Docker

# Build environment Dockerfile with pre-installed Go tools and dependencies
# Optimized for CI/CD pipeline speed
# Updated to include Node.js for GitHub Actions compatibility
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 \
nodejs \
npm \
postgresql-client \
tar # Add GNU tar for cache compatibility
# 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
# Simple build environment - source code is mounted at runtime
WORKDIR /build
# Copy only go.mod and go.sum first for dependency caching
COPY go.mod go.sum ./
RUN go mod download && go mod verify
# Pre-download common Go tools (already installed in base)
# RUN go install github.com/swaggo/swag/cmd/swag@latest