Skip to content

Conversation

@phcorp
Copy link
Contributor

@phcorp phcorp commented Jul 29, 2025

Summary

This PR replaces waitress by gunicorn.

Testing

Run the production server

Make sure your .env.local file does not contain a value for the variable SERVER_ENV.

Execute the following command:

$ make start

The server should launch with gunicorn.

Run the development server

Add this line to your .env.local file:

SERVER_ENV=dev

Execute the following command:

$ make start

The server should launch without gunicorn.


This fixes #21

@phcorp phcorp force-pushed the feat/replace-waitress-by-unicorn branch from e54c63d to 2d79a45 Compare July 29, 2025 20:53
@PonteIneptique PonteIneptique requested a review from Haguili July 30, 2025 09:34
Comment on lines +15 to +16
db.drop_all()
db.create_all()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The current main constant for XML Processing leads to potentiel app crashes

2 participants