Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an app running on Heroku. I don't want anyone to copy my repo. So ı want to put *if* to main file from Dockerfile.

Here is my Dockerfile:

JavaScript
FROM fu***/wha****:latest

RUN git clone https://github.com/phaticusthiccy/WhatsAsenaDuplicated/ root/WhatsAsenaDuplicated
WORKDIR /root/WhatsAsenaDuplicated/
ENV TZ=Europe/Istanbul
RUN npm install deepai
RUN npm install supervisor -g
RUN npm install

CMD ["node", "bot.js"]


Bot can be cloned if the change "RUN git clone"

So ı want to scrap this line and add to bot.js
Using if / else

JavaScript
if (xxx == 'phaticusthiccy/WhatsAsenaDuplicated') {
...

And

JavaScript
}
else {
...


How can I do that? What should I add where it says xxx?

What I have tried:

Nothing, ı don't know how to do this.
Posted
Updated 14-Feb-21 11:31am
v2
Comments
Dave Kreskowiak 15-Feb-21 1:26am    
If you don't want anyone to copy your repo, make your repo private.

Putting an if statement in the Dockerfile is ridiculous because it's a text file that anyone can modify and just remove the "security" you put in it.
Xenon67 15-Feb-21 4:30am    
I dont put it in the dockerfile. I will put in bot.js. ı want to scrape code from Dockerfile. If the code on line 3 in the dockerfile changes, the bot will not work. So i want to put if / else in bot.js
Dave Kreskowiak 15-Feb-21 9:56am    
OK, that wasn't exactly clear. In either case, .js is still just a text file that can be modified to remove your protection.

Your .js file would have to write an entirely new Dockerfile, either with or without the URL to your repository. People will still know the URL just by looking at the URL is your .js code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900