Created
February 5, 2018 08:06
-
-
Save aisurfer/882bdf11ab16ac4f8c68f02c6ea2ce1e to your computer and use it in GitHub Desktop.
docker http service howto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dockerfile | |
FROM python:2-alpine3.7 | |
WORKDIR /usr/src/app | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
EXPOSE 8000 | |
CMD ["gunicorn", "myapp:app"] | |
requirements.txt | |
Flask==0.10.1 | |
gunicorn==19.4.5 | |
INSTALL | |
#!/usr/bin/env bash | |
set -xue -o posix -o pipefail | |
# https://www.digitalocean.com/community/tutorials/docker-ubuntu-16-04-ru | |
sudo apt-get update | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
sudo apt-get update | |
apt-cache policy docker-engine | |
echo "EXAMPLE | |
docker-engine: | |
Installed: (none) | |
Candidate: 1.11.1-0~xenial | |
Version table: | |
1.11.1-0~xenial 500 | |
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages | |
1.11.0-0~xenial 500 | |
500 https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages | |
" | |
sudo apt-get install -y docker-engine | |
sudo systemctl status docker | |
echo "OUTPUT EXAMPLE | |
docker.service - Docker Application Container Engine | |
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) | |
Active: active (running) since Sun 2016-05-01 06:53:52 CDT; 1 weeks 3 days ago | |
Docs: https://docs.docker.com | |
Main PID: 749 (docker) | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment