/
iezhelev
/
cppsh_micro
Обзор
Документация
Войти
/
iezhelev
/
cppsh_micro
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
Dockerfile.sync
40 строк
976 B
iezhelev
first commit
24 фев 2025, 14:23
24 фев 2025, 14:23
5899117
Код
Авторство
О чём код?
# Dockerfile # Stage 1: Build the generator and sync-service binaries ##FROM node:18-alpine AS generator # Set working directory ##WORKDIR /app # Copy the Node.js generator script and its dependencies #COPY cmd/generator/generator.js ./cmd/generator/ ##COPY cmd/generator/*.js ./cmd/generator/ ##COPY cmd/generator/package*.json ./ # Install Node.js dependencies (if any) ##RUN npm install --production # Run the generator to produce necessary files ##RUN node ./cmd/generator/generator.js 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 . . ##COPY --from=generator /app/generated ./generated/ RUN go mod download RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o sync_service ./cmd/sync/main.go FROM alpine:latest WORKDIR /app COPY --from=builder /app/sync_service . CMD ["./sync_service"]