FROM ubuntu:22.04 RUN apt-get update && \ apt-get install -y --no-install-recommends ca-certificates && \ rm -rf /var/lib/apt/lists/* # HuggingFace Spaces requires non-root user RUN useradd -m -u 1000 appuser WORKDIR /app # Copy pre-built binary (built with: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o api ./cmd/api) COPY api . RUN chmod +x /app/api COPY config.json . COPY holiday.json . # Create data directory RUN mkdir -p /app/data && chown -R appuser:appuser /app USER appuser # HuggingFace Spaces ONLY exposes port 7860 EXPOSE 7860 ENV PIPE_API_PORT=7860 ENV PIPE_PARQUET_BASE=/app/data ENV PIPE_HOLIDAY_FILE=/app/holiday.json CMD ["./api", "-config", "/app/config.json", "-holidays", "/app/holiday.json"]