Perplexica/app.dockerfile
WanQuanXie 2f90e3f1a2 build(app): optimize app docker image size
export app static pages and deploy with Nginx image, instead of host `next start` service
2024-05-08 18:07:39 +08:00

17 lines
No EOL
348 B
Docker

FROM node:alpine as builder
ARG NEXT_PUBLIC_WS_URL
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL}
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
WORKDIR /home/perplexica
COPY ui /home/perplexica/
RUN yarn install
RUN yarn build
FROM nginx:stable-alpine-slim
COPY --from=builder /home/perplexica/out /usr/share/nginx/html