-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for Docker #3
Changes from 1 commit
47e72cf
3d5d3df
fc05b8e
7d3afec
81ef556
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
./node_modules | ||
./project | ||
.DS_Store | ||
.dockerignore | ||
Dockerfile | ||
.git | ||
./files/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There isn't a folder called |
||
.gitignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing final EOL. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ VERSION.json | |
.DS_Store | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
./project | ||
project | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where does it come from? |
||
package-lock.json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM node:lts-alpine3.11 | ||
RUN apk add chromium | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
ENV CHROMIUM_PATH /usr/bin/chromium-browser | ||
RUN mkdir -p /home/node/draw.io-export /files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part looks OK to me. |
||
WORKDIR /home/node/draw.io-export | ||
COPY . . | ||
RUN npm install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Further, consider |
||
VOLUME ["/files"] | ||
ENTRYPOINT [ "sh", "convert.sh" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing final EOL. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
echo "DRAW.IO-EXPORT Started." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
dirs=$(find /files -name '*.drawio') | ||
|
||
for dir in $dirs | ||
do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This scripts will fail if any of the files contains "abnormal" characters, like spaces.
Alternatively, you can try combining the two scripts together and, at the beginning of the script, check |
||
echo "Converting ${dir} to ${dir}.pdf" | ||
rm $dir.pdf | ||
node /home/node/draw.io-export/bin/drawio.js $dir -o $dir.pdf | ||
echo "Converting ${dir} to ${dir}.png" | ||
rm $dir.png | ||
node /home/node/draw.io-export/bin/drawio.js $dir -o $dir.png | ||
done | ||
echo "DRAW.IO-EXPORT Finished." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does it come from?