/
iezhelev
/
cppsh_micro
Обзор
Документация
Войти
/
iezhelev
/
cppsh_micro
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
Dockerfile.command
27 строк
538 B
iezhelev
first commit
24 фев 2025, 13:52
24 фев 2025, 13:52
7ac2ca6
Код
Авторство
О чём код?
# Build stage FROM golang:1.22-alpine AS builder WORKDIR /app # Copy only the files needed for dependency resolution COPY go.mod go.sum ./ # Download dependencies RUN go mod download # Copy the rest of the application code COPY . . # Build the application with optimizations RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o command ./cmd/command/main.go # Final stage FROM alpine:latest WORKDIR /app # Copy only the binary from the builder stage COPY --from=builder /app/command . # Run the application CMD ["./command"]