Dockerfile 697 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM node:22-alpine AS frontend-builder
  2. WORKDIR /aiproxy/web
  3. COPY ./web/ ./
  4. RUN npm install -g pnpm
  5. RUN pnpm install && pnpm run build
  6. FROM golang:1.25.2-alpine AS builder
  7. WORKDIR /aiproxy/core
  8. COPY ./ /aiproxy
  9. COPY --from=frontend-builder /aiproxy/web/dist/ /aiproxy/core/public/dist/
  10. RUN sh scripts/swag.sh
  11. RUN go build -trimpath -ldflags "-s -w" -o aiproxy
  12. FROM alpine:latest
  13. RUN mkdir -p /aiproxy
  14. WORKDIR /aiproxy
  15. VOLUME /aiproxy
  16. RUN apk add --no-cache ca-certificates tzdata ffmpeg curl && \
  17. rm -rf /var/cache/apk/*
  18. COPY --from=builder /aiproxy/core/aiproxy /usr/local/bin/aiproxy
  19. ENV PUID=0 PGID=0 UMASK=022
  20. ENV FFMPEG_ENABLED=true
  21. EXPOSE 3000
  22. ENTRYPOINT ["aiproxy"]