Building a Flask app with Docker Nginx and uwsgi
In the general settings, you’ll want to expose the daemon without TLS.
Docker for Windows has been recently renamed to Docker Desktop, so if your settings look slightly different than the screenshot, no worries. It’s the same thing.
sudo apt-get update -y
sudo apt-get install -y
apt-transport-https
ca-certificates
curl
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable"
sudo apt-get update -y
sudo apt-get install -y docker-ce
sudo usermod -aG docker $USER
Install Docker Compose
We’re going to install Docker Compose using PIP instead of the pre-compiled binary on GitHub because it runs a little bit faster (both are still Python apps).
sudo apt-get install -y python python-pip
pip install --user docker-compose
echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc
export DOCKER_HOST=tcp://127.0.0.1:2375
docker info
docker-compose --version
apt-get install build-essential python
apt-get install python-dev
pip install uwsgi
pip install https://projects.unbit.it/downloads/uwsgi-lts.tar.gz
Install Compose on Linux systems
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Test the installation.
docker-compose --version
apt-get install python-virtualenv
$ source activate