docker-nginx icon indicating copy to clipboard operation
docker-nginx copied to clipboard

Better usage instructions for OSX

Open advance512 opened this issue 9 years ago • 0 comments

Using the Docker Quickstart Terminal (which is: bash --login '/Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/start.sh' ):

cd ~/workspace/docker
mkdir -p tut2/data/www
cd tut2

# create all directories and files as explained here:
# https://github.com/dylanlindgren/docker-nginx/blob/master/README.md

docker pull dylanlindgren/docker-phpfpm
docker run --privileged=true --name tut2_php -v /Users/YOURNAME/workspace/docker/tut2/data/www:/data/www:rw -d dylanlindgren/docker-phpfpm
docker start tut2_php


# To verify all makes sense
docker ps
docker inspect tut2_php

docker pull dylanlindgren/docker-nginx
# Note the network link alias MUST be :fpm, since there's a var called %fpm-ip% that is used inside:
# https://github.com/dylanlindgren/docker-nginx/blob/master/config/nginx.conf
docker run --privileged=true -p 80:80 -p 443:443 --name tut2_nginx -v /Users/YOURNAME/workspace/docker/tut2/data/config:/data/nginx/config:rw --volumes-from tut2_php --link tut2_php:fpm -d dylanlindgren/docker-nginx
docker start tut2_nginx

# If you have any issues, you can always look inside the container:
# docker exec -i -t tut2_nginx /bin/bash

# To verify all makes sense
docker ps
docker inspect tut2_nginx

# Point www.website1.com to the IP address of the Docker VM, which you can see by running `boot2docker ip` on OSX or by looking at the interface itself on Linux, `ifconfig` 
sudo vi /etc/hosts

# Finally, you can:
curl http://www.website1.com

advance512 avatar Jun 05 '16 13:06 advance512