Last active
May 25, 2017 04:53
-
-
Save prabirshrestha/9868075 to your computer and use it in GitHub Desktop.
docker and fig
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
http://code.tutsplus.com/tutorials/easily-deploy-redis-backed-web-apps-with-docker--cms-20405 | |
vagrant box add ubuntu12 http://files.vagrantup.com/precise64.box | |
vagrant box init ubuntu12 | |
vagrant box up | |
vagrant ssh | |
sudo apt-get update | |
sudo apt-get install -y curl | |
curl -s https://get.docker.io/ubuntu/ | sudo sh | |
# verify docker - type exit to exit | |
sudo docker run -i -t ubuntu /bin/bash | |
# Add the docker group if it doesn't already exist. | |
sudo groupadd docker | |
sudo gpasswd -a ${USER} docker | |
sudo service docker restart | |
http://orchardup.github.io/fig/ | |
sudo apt-get install -y python-pip | |
sudo pip install -U fig | |
sudo apt-get install -y software-properties-common python-software-properties | |
sudo add-apt-repository -y ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install -y build-essential python git nodejs | |
Dockerfile | |
```Dockerfile | |
FROM ubuntu:12.04 | |
RUN sudo apt-get update | |
RUN sudo apt-get install -y software-properties-common python-software-properties | |
RUN sudo add-apt-repository ppa:chris-lea/node.js | |
RUN sudo apt-get update | |
RUN sudo apt-get install build-essential python git nodejs | |
RUN sudo apt-get install -y graphicsmagick imagemagick | |
ADD . /src | |
WORKDIR /src | |
RUN npm install --production | |
EXPOSE 1337 | |
``` | |
fig.yml | |
```fig | |
web: | |
build: . | |
command: node server.js | |
ports: | |
- "1337:1337" | |
``` | |
sudo fig up | |
config.vm.network "forwarded_port", guest: 1337, host: 1337 | |
vagrant reload | |
http://www.serfdom.io/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment