-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Doc] Update Vizro docs and example template #306
Conversation
dashboard = vm.Dashboard(pages=[page]) | ||
|
||
# Create the application instance | ||
app = Vizro().build(dashboard) | ||
|
||
# Expose the Flask server to Gunicorn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
||
# Copy application files | ||
COPY . . | ||
|
||
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run
doesn't seem to exist unless I missed something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 . . | ||
|
||
# Expose the port |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this should have been 80 all along?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's my error, the port 80 is also is exposed by the platform, so it didn't notice it
@LatentDream please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ✅
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/