Files
IPAGo/Dockerfile
trojvn 7f2dca597f chore(build): update ipatool binary path in dockerfile
update the path of the ipatool binary in the dockerfile to ensure it is copied to the correct location in the container
2026-03-10 04:08:24 +03:00

36 lines
1.3 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# --- ЭТАП 1: Сборка ---
FROM golang:1.25-alpine AS builder
# Устанавливаем рабочую директорию
WORKDIR /app
# Копируем файлы зависимостей
# Это делается отдельно, чтобы Docker кэшировал слои с модулями
COPY go.mod go.sum ./
RUN go mod download
# Копируем исходный код
COPY . .
# Собираем бинарный файл
# CGO_ENABLED=0 нужен для статической линковки (чтобы работало в пустом образе)
# GOOS=linux гарантирует сборку под Linux
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/server main.go
# --- ЭТАП 2: Запуск ---
FROM alpine:latest
# Устанавливаем часовой пояс и корневые сертификаты (важно для HTTPS запросов)
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
# Копируем только скомпилированный файл из предыдущего этапа
COPY --from=builder /app/server .
COPY --from=builder /app/bin/ipatool /bin/ipatool
# Открываем порт (тот же, что в коде Huma)
EXPOSE 8888
# Запускаем приложение
CMD ["./server"]