Report this

What is the reason for this report?

In droplet : My Docker running a Flask server on port 6000 is not accessible outside

Posted on June 18, 2021

Hello guys,

I have an issue with a droplet.

When I run my docker on host 0.0.0.0 and on port 6000 It seems it is not accessible when I do <public ip address>:6000

Although, following the tutorial here, I have ran the commands below : sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw enable sudo ufw allow 6000/tcp

Does someone knows if the port 6000 is allowed to be used in DO or I forgot to configure something ?

Below the dockerfile :

FROM python:3.8.1

ENV FLASK_APP=nace_recommender.api.app:app
ENV FLASK_ENV=development
ENV WORKERS=4

RUN useradd -b /home -U banana && mkdir -p /home/banana/app
COPY . /home/banana/app
RUN chown -R banana:banana /home/banana
USER banana

# set working directory
WORKDIR /home/banana/app

RUN pip install -r requirements.txt 

EXPOSE 6000

CMD /home/banana/.local/bin/gunicorn --preload -w $WORKERS -b 0.0.0.0:6000 "nace_recommender.api.app:app()" -t 60

The developer cloud

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

Start building today

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