I followed the instructions here. https://www.digitalocean.com/community/tutorials/how-to-build-and-deploy-a-flask-application-using-docker-on-ubuntu-18-04 I’m trying to get my website to use NGINX and have a Docker Container serving my Flask Application. It is working, but it is on port 56733. I’m trying to have the Flask App served whenever anyone visits my web page. Could I just change the code below from start.sh
#!/bin/bash
app="docker.test"
docker build -t ${app} .
docker run -d -p **56733**:80 \
--name=${app} \
-v $PWD:/app ${app}
to
#!/bin/bash
app="docker.test"
docker build -t ${app} .
docker run -d -p **80**:80 \
--name=${app} \
-v $PWD:/app ${app}
I’m a noob at this and am doing this to learn more about Docker, Flask and NGINX. If anyone has any resources which explain NGINX well or deploying Docker on NGINX that would be greatly appreciated. I’ve been googling, but haven’t found the resources I’ve locate very helpful.
#!/bin/bash
app="docker.test"
docker build -t ${app} .
docker run -d -p **56733**:80 \
--name=${app} \
-v $PWD:/app ${app}
to
#!/bin/bash
app="docker.test"
docker build -t ${app} .
docker run -d -p **80**:80 \
--name=${app} \
-v $PWD:/app ${app}
I’m a noob at this and am doing this to learn more about Docker, Flask and NGINX. If anyone has any resources which explain NGINX well or deploying Docker on NGINX that would be greatly appreciated. I’ve been googling, but haven’t found the resources I’ve locate very helpful.
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!
Yes, it would work if you change the port from 56733 to 80, that way if you visit your IP or your page directly from the browser you would not have to specify a port after it, as port 80 would be bound on the host.
However, I think that a better approach would be to use Nginx as a reverse proxy and pass the traffic from port 80 and port 443 to the 56733 port. You could follow the steps on how to configure Nginx for your docker here:
https://www.thepolyglotdeveloper.com/2017/03/nginx-reverse-proxy-containerized-docker-applications/
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.