feat: AI 미디어 허브 초기 세팅 및 뼈대 코드 완성
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 3m7s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 3m7s
This commit is contained in:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
# Stage 1: Build the Go application
|
||||
FROM golang:1.21-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
# Mock basic go mod init so it can build without external pre-requisites
|
||||
RUN go mod init ai-media-hub && \
|
||||
go get github.com/gofiber/fiber/v2 github.com/gofiber/fiber/v2/middleware/cors github.com/gofiber/fiber/v2/middleware/logger github.com/gofiber/websocket/v2
|
||||
COPY backend/ ./backend/
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /ai-media-hub ./backend/main.go
|
||||
|
||||
# Stage 2: Final runtime container with Python & Go binary
|
||||
FROM python:3.10-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies (ffmpeg for yt-dlp processing)
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends ffmpeg curl ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python worker requirements
|
||||
COPY worker/requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy Go binary from builder
|
||||
COPY --from=builder /ai-media-hub /app/ai-media-hub
|
||||
|
||||
# Copy Frontend files and worker files
|
||||
COPY frontend/ ./frontend/
|
||||
COPY worker/ ./worker/
|
||||
|
||||
# Expose port (Internal 8000)
|
||||
EXPOSE 8000
|
||||
|
||||
# Entrypoint: Run Go backend
|
||||
CMD ["/app/ai-media-hub"]
|
||||
Reference in New Issue
Block a user