Deploy a Plotly Dash data visualization app for free on Google Cloud Run in a few simple steps.

How to deploy a data visualization app that uses Plotly Dash a Plotly express on Google Cloud Run for free. I will show you all the steps and no prior knowledge is required. Please find the source code below.
✅ Subscribe for more videos like this one
🔔 Click on the bell icon to be notified when I release a new video
👍 Please like my video!
⚠️ Join my channel to get access to perks: / @federicotartarini
🙏 Support my channel on Patreon at / federicotartarini
☕ Support my channel by buying me a coffee - www.buymeacoffee.com/FedericoT
🎥 Playlists you may find useful:
➜ Google Cloud Platform:
• Google Cloud Console
➜ Beamer LaTeX course:
• LaTeX Beamer
➜ Full LaTeX course:
• LaTeX
➜ PyCharm course:
• PyCharm
➜ Building a documentation website with Docusaurus:
• Docusaurus
🎥 Videos you may find useful:
➜ Build and deploy a documentation website using Docusaurus 2: • Build and deploy a doc...
➜ Add a glossary to your document containing terms and acronyms: • Add a glossary to your...
➜ Write a paper using the Elsevier template: • How to Get Started and...
➜ Overleaf and GitHub integration: • Overleaf and GitHub in...
➜ Review a document in Overleaf: • Review a document in O...
➜ Export citations from Mendeley into LaTeX: • Export citations from ...
➜ Pandas DataFrame to LaTeX table: • Pandas DataFrame to La...
➜ How to use git and GitHub with PyCharm: • How to use git and Git...
➜ Use Grammarly in Overleaf ✍️: • Use Grammarly in Overl...
➜ TeXiFy - PyCharm IntelliJ LaTeX plug-in: • TeXiFy - PyCharm Intel...
➜ Nomenclature in LaTeX document: • Nomenclature in LaTeX ...
➜ Why you should start using LaTeX now!!: • 10 Reasons Why You Sho...
✅ Let's connect:
🌍 My website - federicotartarini.github.io/
💻 GitHub - github.com/FedericoTartarini
Twitter - / federicotartar1
LinkedIn - / federico-tartarini
📝 Useful notes:
dash.plotly.com/
cloud.google.com/sdk/docs/ins...
👨‍💻 Source code:
Dash basic application code: dash.plotly.com/layout
Change the last two lines as follows:
```
if _name_ == '__main__':
app.run_server(debug=False, host="0.0.0.0", port=8080)
```
Dockerfile:
```
Use the official lightweight Python image.
hub.docker.com/_/python
FROM python:3.8
Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
Install production dependencies.
RUN pip install -r requirements.txt
EXPOSE 8080
CMD python app.py
```
Commands to build and deploy the application
```
gcloud builds submit --tag gcr.io/ProjectID/dash-youtube-example --project=ProjectID
gcloud run deploy --image gcr.io/ProjectID/dash-youtube-example --platform managed --project=ProjectID --allow-unauthenticated
```
requirements.txt
```
dash==1.20.0
pandas==1.2.4
plotly==4.14.3
```
🎥 Content of this video:
00:00 - What you will learn
00:10 - Plotly Dash
02:00 - Google Cloud Run
03:30 - Create a new project
10:00 - Deploy app locally
13:00 - Build the application
18:00 - Deploy application on Google Cloud Run
🔣 Keywords:
#Dash #Plotly #PlotlyDash #PlotlyExpress #GoogleCloudRun #GoogleCloud #DataVisualization #WebApplication #GoogleCloudConsole

Пікірлер: 67

  • @jamesmutumba1010
    @jamesmutumba10102 жыл бұрын

    Amazing video, thank you. Saved me after spending hours on the internet.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I am glad you found my video useful. Thank you for writing a comment. 🙂

  • @tatinogues728
    @tatinogues7282 жыл бұрын

    With your tutorial I could finally deploy mi first web app on Google Cloud!!! You made it super easy and clear!! Thanks a lot! :)

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I am very happy to hear that it helped you. Thank you so much for leaving a comment.

  • @williamagyapong6337
    @williamagyapong633710 күн бұрын

    Very helpful and straight to the point! You saved me some headaches 😅. Thanks for sharing!

  • @FedericoTartarini

    @FedericoTartarini

    8 күн бұрын

    You are welcome

  • @padula77
    @padula77 Жыл бұрын

    Grande Federico!

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Grazie mille

  • @jacketguy18
    @jacketguy18 Жыл бұрын

    Federico, thank you so much

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    You are welcome, I am glad you liked my video.

  • @guilhermepalazzo1289
    @guilhermepalazzo1289 Жыл бұрын

    Amazing tutorial, thanks for that.

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    You're very welcome!

  • @victorl.mercado5838
    @victorl.mercado58382 жыл бұрын

    Great information. Thanks.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    You are welcome. Thank you for leaving a comment.

  • @gabrielb_11
    @gabrielb_112 жыл бұрын

    Thanks, its works

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I am glad it worked well. Thank you for writing a comment.

  • @sucharitapilli
    @sucharitapilli2 жыл бұрын

    Excellent work

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Thank you so much, I am glad you liked it.

  • @guillermobarrio55
    @guillermobarrio55 Жыл бұрын

    All I can say is thank you so much!! I just created my first app.

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    You are most welcome. I am very happy to hear that my video helped you.

  • @guillermobarrio55

    @guillermobarrio55

    Жыл бұрын

    @@FedericoTartarini Hi Federico, just one more thing: I have noticed that the execution time is about 10-15 seconds only; then the app stops. I would need it to go on for a little longer. Is there anyway to change this? Thanks again!

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    What do you mean it stops? It should not stop

  • @jimzhang2562
    @jimzhang25622 жыл бұрын

    thank you for the video

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    You're welcome

  • @al-moayyad1391
    @al-moayyad13912 жыл бұрын

    Thanks for the amazing work! What if the deployed app connects to data source in the cloud (not Google), can we manage connectivity?

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Thank you very much. Sure you can query data from any cloud database of your choice. Just create a connection with the database and query the data you need.

  • @SuperJaimmew
    @SuperJaimmew Жыл бұрын

    Life saver

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Glad it helped you.

  • @ad-op5xt
    @ad-op5xt2 ай бұрын

    useful tutorial

  • @FedericoTartarini

    @FedericoTartarini

    2 ай бұрын

    Thank you.

  • @Oladayo1
    @Oladayo12 жыл бұрын

    Hi... Thank you for this. Is it possible to have a trigger for the app anytime a new file is uploaded to the storage bucket? How will one go about it? Also, can one use AWS lambda to deploy plotly dash app? I have tried with no success.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Surely you can do that by using GitHub actions. I have a video on this.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I don't know if you can deploy it using an AWS lambda function

  • @geraldineberriosanchez6328
    @geraldineberriosanchez6328 Жыл бұрын

    Thanks for the tutorial, I just obtained this error: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Hi, you are welcome. Have you followed the step by step instructions as shown in the video?

  • @geraldineberriosanchez6328

    @geraldineberriosanchez6328

    Жыл бұрын

    @@FedericoTartarini Yes, I followed all steps exactly in the way you did, but reviewing the log I also found this message :python: can't open file 'app.py'

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    It is strange since it was working for me. Have you place the files in the right folder? If you try to run the file locally using python is it working?

  • @diegoalzatev
    @diegoalzatev Жыл бұрын

    Hi, thanks for the video! can we change the url of the app for one with own domain?

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Yes you can. Google has documentation on how to do that

  • @kalpaashhar6522
    @kalpaashhar65222 жыл бұрын

    Very useful video - I am trying to solve a port issue between my dash app and the GCP Container port. I see that you modified the dash app port to 8080. What if I leave it at the default for 8050 (which is the case in my app), and build it through GKE - Can you touch upon these differences . If the app port is different and container exposed port is different, how does that impact and what yaml changes need to be made

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Thank you so much. Unfortunately, I never used GKE, but the configuration file should be working in a similar way. You should be able to use the port 8050 and then in the yaml file you just need to write which port you want to expose. Have you tried that? Alternatively, try to follow the same instructions as shown in the video and change the port to 8080. That should work.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Let me know if it works.

  • @kalpaashhar6522

    @kalpaashhar6522

    2 жыл бұрын

    @@FedericoTartarini Yes did try it. Build is successful. Run also starts, but the exposed IP is different from the one specified in the app.run_server() - a new IP gets created. And that IP doesnt work, it attempts to connect, but just times out. Let me see if I can paste a few snapshots here. Btw - the technique shared by you in the video works perfectly, thanks for that! At least I have a running app.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Sorry to hear that you are still facing some issues. I cannot see one of your comments.

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Have you checked on stackoverflow for a solution or in the official Google documentation?

  • @mustafaalsaegh7536
    @mustafaalsaegh75369 ай бұрын

    one major thing this doesn't mention is the service account and how to grant access

  • @arieljumba9754
    @arieljumba97542 жыл бұрын

    hank for this. However, You lost most of us at the gcloud part. What next after installing the gcloud sdk?

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Hi, sorry but what do you mean? In the video I show how to deploy it to Google Cloud Run

  • @arieljumba9754

    @arieljumba9754

    2 жыл бұрын

    @@FedericoTartarini yes, however there is still a process required to enable running gcloud on the pycharm terminal. Anyways maybe that could be on your next video?

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Hi, sorry that it is not clear from the video. But you do not need to use pycharm. I am using the computer terminal via pycharm but you do not need to do so. You can open the computer terminal, navigate to the project directory, and use the same commands as I show in the video.

  • @arieljumba9754

    @arieljumba9754

    2 жыл бұрын

    It comes with so many errors in each step. Mine stopped at the deployment level. Maybe you could kindly do a separate video on that process

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Okay I'll try to create a specific video on that.

  • @biggo1261
    @biggo12616 ай бұрын

    Hi my Dash app is not loading, it said unable to load Layout. But same thing runs fine locally and on aws.

  • @FedericoTartarini

    @FedericoTartarini

    6 ай бұрын

    Sorry but I am not understanding. Aren’t you able to run it both locally and on AWS?

  • @biggo1261

    @biggo1261

    6 ай бұрын

    @@FedericoTartarini Yes I was able to run locally and on aws but not gcp , it shows 500 error in the console and when I try with web browser it Unable to load the Layout. Appreciate your response.

  • @priyanshpradhan4152
    @priyanshpradhan41522 жыл бұрын

    When I do the gcloud build I'm getting the following error 'The user is forbidden from accessing the bucket'

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    Have you followed all the instruction as shown in the video?

  • @priyanshpradhan4152

    @priyanshpradhan4152

    2 жыл бұрын

    @@FedericoTartarini yes I rewatched the video and it's working now 👍 thanks for the wonderful tutorial

  • @FedericoTartarini

    @FedericoTartarini

    2 жыл бұрын

    I am glad you found a solution to the problem 🙂

  • @priyanshpradhan4152

    @priyanshpradhan4152

    2 жыл бұрын

    @RangerHitam142 Gaming I can't remember but I think it had something to do with the docker file, a rewatch helps.

  • @amyzeng7130
    @amyzeng7130 Жыл бұрын

    The problem resolved by changing python:3.9.3 to python:3.8

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Thank you for letting me know

  • @TheEugevanz
    @TheEugevanz Жыл бұрын

    It WORKS!!!

  • @FedericoTartarini

    @FedericoTartarini

    Жыл бұрын

    Great