diff --git a/app.dockerfile b/app.dockerfile index 105cf86..f0e5560 100644 --- a/app.dockerfile +++ b/app.dockerfile @@ -1,9 +1,4 @@ -FROM node:alpine - -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} +FROM node:alpine as builder WORKDIR /home/perplexica @@ -12,4 +7,20 @@ COPY ui /home/perplexica/ RUN yarn install RUN yarn build -CMD ["yarn", "start"] \ No newline at end of file +FROM node:alpine as runner + +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 --from=builder /home/perplexica/package.json . +COPY --from=builder /home/perplexica/yarn.lock . +COPY --from=builder /home/perplexica/next.config.mjs . +COPY --from=builder /home/perplexica/.next/standalone . +COPY --from=builder /home/perplexica/public ./public +COPY --from=builder /home/perplexica/.next/static ./.next/static + +ENTRYPOINT ["node", "server.js"] \ No newline at end of file diff --git a/ui/next.config.mjs b/ui/next.config.mjs index c3f2e1a..89a0c95 100644 --- a/ui/next.config.mjs +++ b/ui/next.config.mjs @@ -1,5 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + output: 'standalone', images: { remotePatterns: [ {