-
-
Save LaurentGoderre/b37e28344091ebd1eaa005885a8d03c1 to your computer and use it in GitHub Desktop.
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
sudo -E curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
export http_proxy=[PROXY] | |
export https_proxy=$http_proxy | |
export HTTP_PROXY=$http_proxy | |
export HTTPS_PROXY=$http_proxy | |
git clone https://github.com/LaurentGoderre/docker-demo.git | |
docker run hello-world | |
docker ps | |
1) | |
cd 1/site1/ | |
docker run -dit -p 81:80 --name site1 -v "$PWD"/htdocs:/usr/local/apache2/htdocs/ httpd:alpine | |
cd ../site2/ | |
docker run -dit -p 82:80 --name site2 -v "$PWD"/htdocs:/usr/local/apache2/htdocs/ -v "$PWD"/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf -v "$PWD"/passwd:/usr/local/apache2/passwd httpd:alpine | |
docker exec -it site2 htpasswd /usr/local/apache2/passwd/passwords laurent | |
docker stop site1 site2 && docker rm site1 site2 | |
cd ../site1 | |
docker-compose up -d | |
cd ../site2/ | |
docker-compose up -d | |
2) | |
cd ../2 | |
docker-compose up -d | |
3) | |
cd ../3 | |
docker-compose up -d | |
cat db/data.sql | docker exec -i --user postgres demo3_db sh -c "psql \$POSTGRES_DB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment