ronreiter / interactive-tutorials

Interactive Tutorials
Apache License 2.0
4.03k stars 2.56k forks source link

Support starting local environment with a different domain (not learnpython.org) #633

Closed ronreiter closed 2 years ago

ronreiter commented 2 years ago

The make command needs to be able to support the DOMAIN argument so that

DOMAIN=learnjavaonline.org make dev

would work

shrn01 commented 2 years ago

Hey @ronreiter , I've been working on this issue, docker run -p 5000:5000 interactive-tutorials "-d learn-golang.org" doesn't seem to take me to golang's page, it's still going to python's page.

Can you check

ronreiter commented 2 years ago

@shrn01 you need to modify the Dockerfile for this to work. Can you create a PR and fix it?

shrn01 commented 2 years ago

Yeah I'll work on it

shrn01 commented 2 years ago

Hey Ron, seems like the Gunicorn server doesn't allow taking arguments from the command line. If the docker setup is just for development, we could get away with using the default flask server and use ENV variables in dockerfile to call the specific server.

For production, we need to find some other permanent fix.

ronreiter commented 2 years ago

@shrn01 this is for development only. dev should have an override to run flask dev server instead of gunicorn

ronreiter commented 2 years ago

@shrn01 I finished this just now, please refer to the readme file

shrn01 commented 2 years ago

Hey Ron, yeah I basically did this before with the dockerfile, and then scrapped it as I wasn't able to do it with Gunicorn.

So yeah this is just for dev environment, we don't need to care about production here, so no need for Gunicorn!!

ronreiter commented 2 years ago

Correct. Gunicorn is only required in production, which is why the docker compose overrides the gunicorn command

shrn01 commented 2 years ago

Yeah, here dockerfile and docker-compose are two different ways of running a docker container right, so i didn't get what you meant by override gunicorn before. Everything makes sense now!!