[Doc] Update Vizro docs and example template#306
Conversation
| # Create the application instance | ||
| app = Vizro().build(dashboard) | ||
|
|
||
| # Expose the Flask server to Gunicorn |
There was a problem hiding this comment.
N.B. this is a small simplification Vizro offers over Dash/Flask - no need to explicitly expose the underlying server. The app object already acts as the WSGI server.
| # Configure the container | ||
| EXPOSE 80 | ||
| ENTRYPOINT ["gunicorn", "app:server", "run", "--bind", "0.0.0.0:80"] | ||
| ENTRYPOINT ["gunicorn", "app:app", "--bind", "0.0.0.0:80"] |
There was a problem hiding this comment.
run doesn't seem to exist unless I missed something?
There was a problem hiding this comment.
run doesn't exist. Turn out all our Dockerfile template have it, and the gunicorn ignore it. Thanks for point that out
| @@ -1,24 +1,14 @@ | |||
| FROM python:3.11-slim | |||
There was a problem hiding this comment.
This now matches the docs file exactly.
| @@ -1,24 +1,14 @@ | |||
| FROM python:3.11-slim | |||
|
|
|||
| # Set environment variables | |||
There was a problem hiding this comment.
As far as I could tell these weren't actually necessary for anything. e.g. PIP_NO_CACHE_DIR=off is overridden below anyway by --no-cache-dir.
| # Copy application files | ||
| COPY . . | ||
|
|
||
| # Expose the port |
There was a problem hiding this comment.
I'm pretty sure this should have been 80 all along?
There was a problem hiding this comment.
Yes, that's my error, the port 80 is also is exposed by the platform, so it didn't notice it
|
@LatentDream please review |
|
thanks, @antonymilne |
Thanks for adding vizro in #298! I just have a few corrections and simplifications.
📚 Documentation preview 📚: https://ploomber-doc--306.org.readthedocs.build/en/306/