Spaces:
Running
Running
| # Stage 1: Build from source | |
| FROM golang:1.25-alpine AS builder | |
| RUN apk add --no-cache git ca-certificates | |
| WORKDIR /app | |
| # Clone the repository | |
| RUN git clone https://github.com/ycvk/monica-proxy.git . | |
| # Download dependencies and build | |
| RUN go mod download | |
| RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o monica-proxy main.go | |
| # Stage 2: Runtime with Python proxy | |
| FROM python:3.11-alpine | |
| RUN apk --no-cache add ca-certificates tzdata | |
| WORKDIR /app | |
| COPY --from=builder /app/monica-proxy . | |
| COPY index.html . | |
| COPY server.py . | |
| RUN pip install --no-cache-dir aiohttp | |
| EXPOSE 7860 | |
| CMD ["python", "server.py"] | |