Closed sdbedi closed 2 years ago
As far as I understand, change the domain given in the makefile to the domain you want to work on, and it would work. (e.g. change learnpython.org to learn-golang.org, it should give you golang tutorial page)
Or you could just use virtualenv with python3 and getaway without using docker.
@shrn01 correct. We need to implement this by overriding the website using an environment variable and starting the container with a command line env var (prefixing the make command and passed to docker-compose).
That makes sense - but would we need to edit the website_docker.conf as well?
Moreover, would we want the build to default to learnpython.org in the absence of a command line arg?
I don't think we need to edit the conf files.
I'm thinking of adding a shell script which is the entry point to docker, and it executes gunicorn when in production and flask dev server if in dev mode. Hope this makes sense here.
Defaulting it to learnpython.org can be done using a variable.
Sort of. Would you need to add a shell script though? Couldn't you just pass the command line argument to the makefile?
Yeah we can do that too, but you need to give the entire entry point to the app in the make file i.e. the entire command, but yes, it can be done.
Remember,.the makefile calls dockerfile so this entire command should be passed as an environment variable to the docker file and that variable can be added to the entry point field.
As I said on another issue here, the solution would be to override the entrypoint with the flask dev server alongisde the domain (-d) argument, through the Makefile's docker-compose function.
So basically for dev server we use docker-compose (docker-compose up) and for production it's dockerfile (docker build and docker run) is it?
Sorry if I'm asking too much, I have very litte experience with docker.
Actually, I haven't really set up a production deployment script at all. Right now I just run docker compose up on an instance. The production set up should use Digital Ocean's applications feature.
Simplified, please refer to README.md
By default, the makefile will run learnpython.org. Is it possible to run other sites with the makefile? The documentation on this appears to have been cut off -
"The development version of the web server requires that you specify the domain you are working on, e.g.:"