diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..de4d1f0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/.gitignore b/.gitignore index f152266..0ae7d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules __pycache__ static templates -.env \ No newline at end of file +.env +dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 248197d..e41a27a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,25 +6,9 @@ FROM node:14.14.0 as node-build ARG VUE_APP_BUCKET_URL_PUBLIC_PATH ARG VUE_APP_HYDROSHARE_URL -ADD . /hydroshare +ADD . / -WORKDIR /hydroshare/hs_discover +WORKDIR / -RUN rm -rf static templates && \ - mkdir static templates && \ - mkdir templates/hs_discover && \ - mkdir static/js && \ - mkdir static/css && \ - npm install && \ - npm run build && \ - mkdir -p static/js && \ - mkdir -p static/css && \ - cp -rp templates/hs_discover/js static/ && \ - cp -rp templates/hs_discover/css static/ && \ - cp -p templates/hs_discover/map.js static/js/ && \ - echo "----------------js--------------------" && \ - ls -l static/js && \ - echo "--------------------------------------" && \ - echo "----------------css-------------------" && \ - ls -l static/css && \ - echo "--------------------------------------" \ No newline at end of file +RUN npm install && \ + npm run build \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 99584dc..93f9ff3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -2,7 +2,7 @@ module.exports = { devServer: { allowedHosts: 'all', }, - outputDir: "templates/hs_discover/", + // outputDir: "templates/hs_discover/", // Here profiding the ability to override the publicPath via an environment variable // Example export VUE_APP_BUCKET_URL_PUBLIC_PATH=http://my-public-bucket && npm run build // This should be the same as the STATIC_URL in the Django settings