From fa024ac47a3d608b466b993ecea717cb486419d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 15 Jul 2019 12:04:13 +0200 Subject: [PATCH] Sledgehammer the file permission problem on docker NuxtJS wants to write into .nuxt. If the docker container writes into .nuxt it will have the file permissions of the docker container user even on the host system. So on the host system you cannot remove the folder .nuxt anymore. This gets in the way of running NuxtJS on the host system. --- docker-compose.yml | 1 + webapp/.gitignore | 2 ++ webapp/nuxt.config.js | 3 +++ 3 files changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index ca66217c2..93e80d9c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,7 @@ services: networks: - hc-network environment: + - NUXT_BUILD=.nuxt-dist - HOST=0.0.0.0 - GRAPHQL_URI=http://backend:4000 - MAPBOX_TOKEN="pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.bZ8KK9l70omjXbEkkbHGsQ" diff --git a/webapp/.gitignore b/webapp/.gitignore index f8c980f7c..bc179d78a 100644 --- a/webapp/.gitignore +++ b/webapp/.gitignore @@ -61,6 +61,8 @@ typings/ # nuxt.js build output .nuxt +# also the build output in docker container +.nuxt-dist # Nuxt generate dist diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index cb3a3c643..7ea1038a9 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -10,7 +10,10 @@ const styleguideStyles = process.env.STYLEGUIDE_DEV ] : '@human-connection/styleguide/dist/shared.scss' +const buildDir = process.env.NUXT_BUILD || '.nuxt' + module.exports = { + buildDir, mode: 'universal', dev: dev,