Files
ai-media-hub/Dockerfile
AI Assistant 8562c44897
Some checks failed
Build and Push Docker Image / docker (push) Failing after 6m4s
feat: AI 미디어 허브 초기 세팅 및 Gemini 2.5 Flash 썸네일 비전 분석 적용
2026-03-12 13:54:20 +09:00

34 lines
843 B
Docker

# Stage 1: Build the Go Application
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Initialize go mod if not exists, download deps
COPY . .
RUN go mod init ai-media-hub || true
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -o ai-media-hub main.go
# Stage 2: Final Image (Python 3.10+ & yt-dlp & Go Binary)
FROM python:3.10-slim
WORKDIR /app
# Install dependencies (ffmpeg for media merging/cropping)
RUN apt-get update && \
apt-get install -y ffmpeg curl && \
rm -rf /var/lib/apt/lists/*
# Install yt-dlp
RUN pip install --no-cache-dir yt-dlp
# Copy Go binary and frontend files from builder
COPY --from=builder /app/ai-media-hub /app/ai-media-hub
COPY --from=builder /app/index.html /app/index.html
# Expose port
EXPOSE 8000
# Directory for NAS mount
RUN mkdir -p /data/nas
# Run the Go server
CMD ["./ai-media-hub"]