Skip to content

Commit

Permalink
Refactor Dockerfile and .gitignore
Browse files Browse the repository at this point in the history
- Update Dockerfile to simplify build process and remove unnecessary steps
- Update .gitignore to exclude dist directory
  • Loading branch information
devincowan committed Oct 1, 2024
1 parent 9673eb7 commit c9e054a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
__pycache__
static
templates
.env
.env
dist
24 changes: 4 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "--------------------------------------"
RUN npm install && \
npm run build
2 changes: 1 addition & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c9e054a

Please sign in to comment.