Dockerfile 807 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-alpine AS builder
  7. RUN apk add --no-cache curl
  8. WORKDIR /aiproxy/core
  9. COPY ./ /aiproxy
  10. COPY --from=frontend-builder /aiproxy/web/dist/ /aiproxy/core/public/dist/
  11. RUN sh scripts/tiktoken.sh
  12. RUN go install github.com/swaggo/swag/cmd/swag@latest
  13. RUN sh scripts/swag.sh
  14. RUN go build -trimpath -ldflags "-s -w" -o aiproxy
  15. FROM alpine:latest
  16. RUN mkdir -p /aiproxy
  17. WORKDIR /aiproxy
  18. VOLUME /aiproxy
  19. RUN apk add --no-cache ca-certificates tzdata ffmpeg curl && \
  20. rm -rf /var/cache/apk/*
  21. COPY --from=builder /aiproxy/core/aiproxy /usr/local/bin/aiproxy
  22. ENV PUID=0 PGID=0 UMASK=022
  23. ENV FFMPEG_ENABLED=true
  24. EXPOSE 3000
  25. ENTRYPOINT ["aiproxy"]