2024-12-04 11:46:42 +00:00
|
|
|
# Первый этап: сборка приложения
|
|
|
|
FROM golang:latest AS builder
|
|
|
|
|
2024-12-14 08:35:45 +00:00
|
|
|
WORKDIR /app
|
2024-12-04 11:46:42 +00:00
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
2024-12-14 08:35:45 +00:00
|
|
|
RUN go build -o aides-repo-api ./cmd/aides-repo-api/main.go
|
2024-12-04 11:46:42 +00:00
|
|
|
|
|
|
|
# Второй этап: создание финального образа
|
2024-12-15 09:03:11 +00:00
|
|
|
FROM registry.altlinux.org/sisyphus/alt:20241211
|
2024-12-04 11:46:42 +00:00
|
|
|
|
2024-12-14 08:35:45 +00:00
|
|
|
RUN \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install apt-repo-tools && \
|
|
|
|
rm -f /var/lib/apt/lists/*.* && \
|
|
|
|
rm -f /var/cache/apt/*.bin
|
|
|
|
|
|
|
|
COPY --from=builder /app/aides-repo-api /bin/aides-repo-api
|
|
|
|
ENTRYPOINT ["/bin/aides-repo-api"]
|