lelinhtinh / de4js

JavaScript Deobfuscator and Unpacker
https://lelinhtinh.github.io/de4js/
MIT License
1.29k stars 325 forks source link

Support Docker #32

Closed Himura2la closed 4 years ago

Himura2la commented 4 years ago

I needed to run this app locally to use it, and was upset when realized that I need ruby with global packages on my host pc. Docker image covers this scenario

lelinhtinh commented 4 years ago

Thanks for PR! I have some problems:

Himura2la commented 4 years ago
  1. It's 0.0.0.0 inside the container (Debian buster). The host Windows port mapping is managed by Docker. We need to listen to 0.0.0.0, because the container is connected to virtual network, and requests come not from localhost
  2. The startup command is represented as an array in CMD https://github.com/lelinhtinh/de4js/pull/32/files#diff-3254677a7917c6c01f55212f86c57fbfR6
Himura2la commented 4 years ago

Proof that it works on Windows image

lelinhtinh commented 4 years ago

I don't think docker configuration should be changed, you can add something like ARG or ENV?

Himura2la commented 4 years ago

I don't think it's required to overcomplicate the Dockerfile with ARGs. Anyone who needs to do something custom, can do docker-compose run web bash, get right into the Debian shell and be absolutely free to do anything.

Instead of 'bash' can be any command with jekyll

Note that changing files inside the container is not easy, so '--watch' is useless. I already thought that 'jekyll build' in Dockerfile and some kind of 'jekyll run' in CMD will be more natural, but I was too lazy to learn what's jekyll and how to use it)) Also, 'jekyll serve' in CMD has an advantage: the errors in code won't break the image, which builds really long and does not cache the RUN layer... So hotfixing the app will be more easy