Question

Deploy Error: Health Checks when deploying container image to the App platform.

Posted April 25, 2021 190 views
DigitalOcean App PlatformFlaskDigitalOcean Container Registry (DOCR)

Hi, I’m facing trouble deploying my container image to the App platform.

I test with a hello-world flask app with uwsgi

My Dockerfile settings:

FROM tiangolo/uwsgi-nginx-flask:python3.8-alpine
RUN apk --update add bash nano
ENV STATIC_URL /static
ENV STATIC_PATH /var/www/app/static

ENV NGINX_WORKER_PROCESSES auto
ENV NGINX_WORKER_CONNECTIONS 1024
ENV NGINX_WORKER_OPEN_FILES 1024

ENV UWSGI_CHEAPER 50
ENV UWSGI_PROCESSES 51

COPY ./requirements.txt /var/www/requirements.txt
RUN pip install -r /var/www/requirements.txt

How I build the image:

app="close-events-webhook-docker"
docker build -t ${app} ./
docker run -d -p 8080:80 \
  -h 0.0.0.0 \
  --name=${app} \
  -v $PWD:/app ${app}

The uswgi.ini file:

[uwsgi]
module = main
callable = app
master = true
touch-reload = /app/uwsgi.ini

I don’t get any specific issues that can be helpful on that regard in the log console, and it seem the app is running.

[2021-04-24T20:37:28.147437258Z] *** Starting uWSGI 2.0.18 (64bit) on [Sat Apr 24 20:37:28 2021] ***
[2021-04-24T20:37:28.147444058Z] compiled with version: 9.2.0 on 01 April 2020 08:20:09
[2021-04-24T20:37:28.147958842Z] os: Linux-4.4.0 #1 SMP Sun Jan 10 15:06:54 PST 2016
[2021-04-24T20:37:28.147973014Z] nodename: close-events-webhook-docker-57fbf64575-g6hvx
[2021-04-24T20:37:28.147977930Z] machine: x86_64
[2021-04-24T20:37:28.148407279Z] clock source: unix
[2021-04-24T20:37:28.148421688Z] pcre jit disabled
[2021-04-24T20:37:28.148988591Z] detected number of CPU cores: 8
[2021-04-24T20:37:28.149006883Z] current working directory: /app
[2021-04-24T20:37:28.149512098Z] detected binary path: /usr/sbin/uwsgi
[2021-04-24T20:37:28.149530168Z] your memory page size is 4096 bytes
[2021-04-24T20:37:28.149536916Z] detected max file descriptor number: 1048576
[2021-04-24T20:37:28.149903783Z] lock engine: pthread robust mutexes
[2021-04-24T20:37:28.156258672Z] thunder lock: disabled (you can enable it with --thunder-lock)
[2021-04-24T20:37:28.161039200Z] uwsgi socket 0 bound to UNIX address /tmp/uwsgi.sock fd 3
[2021-04-24T20:37:28.161074763Z] uWSGI running as root, you can use --uid/--gid/--chroot options
[2021-04-24T20:37:28.161082218Z] *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
[2021-04-24T20:37:28.167060156Z] Python version: 3.8.2 (default, Feb 29 2020, 17:03:31)  [GCC 9.2.0]
[2021-04-24T20:37:28.255522766Z] *** Python threads support is disabled. You can enable it with --enable-threads ***
[2021-04-24T20:37:28.255559115Z] Python main interpreter initialized at 0x5589d3a89480
[2021-04-24T20:37:28.255565464Z] uWSGI running as root, you can use --uid/--gid/--chroot options
[2021-04-24T20:37:28.255571381Z] *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
[2021-04-24T20:37:28.255576646Z] your server socket listen backlog is limited to 100 connections
[2021-04-24T20:37:28.255580994Z] your mercy for graceful operations on workers is 60 seconds
[2021-04-24T20:37:28.275370132Z] mapped 3791840 bytes (3702 KB) for 51 cores
[2021-04-24T20:37:28.282438953Z] *** Operational MODE: preforking ***
[2021-04-24T20:37:29.023708874Z] WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x5589d3a89480 pid: 5 (default app)
[2021-04-24T20:37:29.025727208Z] 2021-04-24 20:37:29,025 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[2021-04-24T20:37:29.026035141Z] 2021-04-24 20:37:29,025 INFO success: uwsgi entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[2021-04-24T20:37:29.026951106Z] uWSGI running as root, you can use --uid/--gid/--chroot options
[2021-04-24T20:37:29.026970566Z] *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
[2021-04-24T20:37:29.026977381Z] *** uWSGI is running in multiple interpreter mode ***
[2021-04-24T20:37:29.026986725Z] spawned uWSGI master process (pid: 5)
[2021-04-24T20:37:29.032359545Z] spawned uWSGI worker 1 (pid: 15, cores: 1)
[2021-04-24T20:37:29.036238033Z] spawned uWSGI worker 2 (pid: 16, cores: 1)
[2021-04-24T20:37:29.037991523Z] spawned uWSGI worker 3 (pid: 17, cores: 1)
....

[2021-04-24T20:37:30.845022992Z] spawned uWSGI worker 50 (pid: 64, cores: 1)
[2021-04-24T20:37:31.031729022Z] running "unix_signal:15 gracefully_kill_them_all" (master-start)...
[]

The App listening to the 8080 HTTP Port

Any help would be appreciated.

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!