feat(server): replace waitress by gunicorn#23
feat(server): replace waitress by gunicorn#23phcorp wants to merge 1 commit intodistributed-text-services:mainfrom
Conversation
e54c63d to
2d79a45
Compare
| db.drop_all() | ||
| db.create_all() |
There was a problem hiding this comment.
i may be wrong here , but wouldn't it be better to conditionnaly control whenever to drop all and recreate the db or not with a flag/arugment
There was a problem hiding this comment.
I completely agree with that comment, but that's not really the purpose of this pull request. This logic should probably be extracted into a command, but I would prefer that to be done in another pull request.
| RUN make install | ||
|
|
||
| ENTRYPOINT exec python -m dapytains.app.app | ||
| ENTRYPOINT exec make start |
There was a problem hiding this comment.
on this point , i want to note that i don't think it's an urgent change at this stage
also i haven't personnaly used make as entrypoints , but what i'm reading is that it hides the gunicorn process behind make , and for prod it can be problematic for signals in general and shutdowns
There was a problem hiding this comment.
imho there is no problem; make handles signals very well. The goal here is to start the server using the dotenv variables. Without make we would have to create a start script that would duplicate the logic already present in the makefile.
Summary
This PR replaces waitress by gunicorn.
Testing
Run the production server
Make sure your
.env.localfile does not contain a value for the variableSERVER_ENV.Execute the following command:
The server should launch with gunicorn.
Run the development server
Add this line to your
.env.localfile:Execute the following command:
The server should launch without gunicorn.
This fixes #21