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
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 there,
The Dockerifle that you’ve shared indicates that the service will listen on port 6000 inside the container itself.
Note that you would need to use the -p 6000:6000 flag and expose the container port to the host.
Then in order to check if the port is exposed correctly on the host you could run the following command:
netstat -plant | grep
Let me know how it goes! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.