Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi, I have seen the hello world page.
How do install a new python package and add it to the flask application.
For example I want to add below line to the flask application to be able to use flask_mail. I installed flask_mail using pip3 and then added below line in the views.py file and then restarted docker. But after adding the new line hello world was not displayed in web page. Please help…
from flask_mail import Mail, Message
Thanks for the article. It works! But I cannot understand how ;( When in app/init.py you write from app import views when executing main from an interactive shell, I do from app import app, then I cannot see app.views, because app is a Flask application. How come the docker container still serves the “/template” page. Is it an effect of how the dir is mounted in the container? Thanks for any hint or pointer. Greetings, xgiannak
Hi!!! Please, can you help me to include in this great and excellent document, how can I add an SSL certificate? I need to deploy with HTTPS protocol?
I sincerely appreciate your help…
Thank you
There seems to be some errors in this tutorial, which I have been trying to debug. The app does not seem to work on a digital ocean droplet.
In “Step 4 — Updating the Application”:
The file /var/www/TestApp/uwsgi.ini is missing the 1st line added in step 1, “[uwsgi]”. So the tutorial is inconsistent because the first line of the file /var/www/TestApp/uwsgi.ini in step 1 is missing in step 4 “Updating the Application”.
Also, the file /app/uwsgi.ini was never added to the project. The /var/www/TestApp/uwsgi.ini file from step 1 was in a different directory at /var/www/, and not in /app. There should be other files from the base docker image, however. But it seems like the tutorial seemed to intend that the touch-reload condition should be for the uwsgi.ini file that was created in the tutorial.
Maybe this should be corrected? Or if it is already correct, maybe it should be explained in the text why the uwsgi.ini’s 1st line, and it’s path are different?
Also, I tried deploying this to my digital ocean droplet using the command:
sudo docker save docker.test | gzip | DOCKER_HOST=ssh://root@ip-address docker load
(The ip-address should be replaced with the droplet’s IP address. I found this command here on stackoverflow).
Maybe this docker host command should be added to the tutorial for users to run their apps on digital ocean droplet servers? I would recommend this.
I then accessed the droplet using
ssh root@ip-address, and checked the open ports using
sudo nc localhost 56733 < /dev/null; echo $? and
sudo nc localhost 80 < /dev/null; echo $?
which returned 1 (usable port).
The start.sh file was not on the droplet server, but only my local computer. So I tried starting the container from an image with
docker run -p 80:80 --name=docker.test -v .:/app docker.test
and
docker run -p 56733:80 --name=docker.test -v .:/app docker.test
But both commands gave me the same error:
Checking for script in /app/prestart.sh
There is no script /app/prestart.sh
CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
INFO Included extra file "/etc/supervisor.d/supervisord.ini" during parsing
INFO RPC interface 'supervisor' initialized
CRIT Server 'unix_http_server' running without any HTTP authentication checking
INFO supervisord started with pid 1
INFO spawned: 'quit_on_failure' with pid 8
INFO spawned: 'nginx' with pid 9
INFO spawned: 'uwsgi' with pid 10
INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
INFO success: uwsgi entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
realpath() of /app/uwsgi.ini failed: No such file or directory [core/utils.c line 3662]
INFO success: quit_on_failure entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO exited: uwsgi (exit status 1; not expected)
WARN received SIGTERM indicating exit request
INFO waiting for quit_on_failure, nginx to die
INFO stopped: nginx (exit status 0)
INFO stopped: quit_on_failure (terminated by SIGTERM)
/usr/lib/python3.8/site-packages/supervisor/options.py:473: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
self.warnings.warn(
Before, much earlier, I previously tried to use the scp command to move the saved docker image .tar file to the server, and running it. This actually worked once, but subsequent attempts at running the app have given this same error.
I learned a lot from the tutorial, but have spent many hours trying to debug this error.
Without working on actual digital ocean droplet virtual private servers, this tutorial cannot be used. Maybe there could be some sort of problem with relying on the docker images tiangolo/uwsgi-nginx-flask:python3.8-alpine which may have potentially changed.
Did anyone else get the realpath() of /app/uwsgi.ini failed: No such file error on a digital ocean droplet?