diff --git a/www/.dockerignore b/www/.dockerignore index f06235c..a21f178 100644 --- a/www/.dockerignore +++ b/www/.dockerignore @@ -1,2 +1,3 @@ node_modules dist +.git diff --git a/www/Dockerfile b/www/Dockerfile index 981965e..5559e45 100644 --- a/www/Dockerfile +++ b/www/Dockerfile @@ -1,14 +1,24 @@ -FROM node:alpine as build +FROM node as build WORKDIR /app # copy the app, note .dockerignore COPY . /app -RUN apk update \ - && apk add --no-cache git python alpine-sdk\ - && npm ci \ +RUN npm ci \ && npm run build \ - && npm run generate + && npm run generate \ + && npm prune --production \ + && curl -sf https://gobinaries.com/tj/node-prune | sh \ + && node-prune + +FROM node:alpine + +WORKDIR /app + +# copy from build image +COPY --from=build /app ./ + +EXPOSE 3000 CMD [ "npm", "start" ] diff --git a/www/nuxt.config.js b/www/nuxt.config.js index 7672516..783ed8d 100644 --- a/www/nuxt.config.js +++ b/www/nuxt.config.js @@ -1,9 +1,5 @@ export default { - /* - ** Nuxt rendering mode - ** See https://nuxtjs.org/api/configuration-mode - */ - mode: "universal", + ssr: true, /* ** Nuxt target ** See https://nuxtjs.org/api/configuration-target