ezaquarii / vpn-at-home

1-click, self-hosted deployment of OpenVPN with DNS ad blocking sinkhole
GNU General Public License v3.0
1.11k stars 90 forks source link

Add docker-compose for development #28

Closed LukasWerfel closed 5 years ago

LukasWerfel commented 5 years ago

Hi @ezaquarii

first of all thank you for the great work on this project! It really helped me out making my RBPi accessible from the internet! :)

Right now, in order to contribute to vpn-at-home, a developer needs to install the prerequisites and make sure things are in ${PATH}.

While for seasoned developers, this might not be a problem, but

Take my exampe: I am mainly a front-end dev by training, and I initially I came to this repo to work on a small front-end thing. But without docker this means I have to work with django, virtualenv, ansible and so on. This makes it hard for me.

With this PR I could just run one command and would be ready to work on what I came to work on. Since it would make the dev environment reproducible, things like this could be made easier for the future. I have also the confidence, that if I break something, I can just throw away the container and rebuild it!

IMHO it makes the project more accessible for contributors. It should also be noted, that IDEs do work with Docker. And it's also totally optional!

Let me know what you think, what requirements you have for this, and what you would like to change!

LukasWerfel commented 5 years ago

Is it possible that daphne is somehow limited from where it can be accessed? Inside docker the server can be reached without a problem. But not from the host, even though the port should be bound correctly.

Found the reason:

Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. Django Docs

ezaquarii commented 5 years ago

Found the reason:

Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. Django Docs

Can you describe your setup? It looks like you're trying to do something I haven't planned. :)

ezaquarii commented 5 years ago

How about ./bin/manage runserver --insecure 0.0.0.0:8001? Remember that this app is not intended to be exposed to the open internet.

LukasWerfel commented 5 years ago

That worked great! Thank you!

LukasWerfel commented 5 years ago

Updated the PR description

ezaquarii commented 5 years ago

Would it be possible to demonstrate some development workflow using this dev docker setup?

LukasWerfel commented 5 years ago

Did #25 as an example, see #31

  1. cloned repo
  2. docker-compose up
  3. go to http://localhost:8001
  4. See Title is VPN@Home
  5. change the files and safed
  6. refresh http://localhost:8001 and saw that it worked