Dockerfile 752 B

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