###Requirements You only need docker installed to use this guide. Meteor, Node and MongoDB will be provided by the docker image.
###Docker Installation Install docker using the instructions for your preferred OS from: https://docs.docker.com/installation/
If you didn't add your user to the docker group you will need to use sudo for all commands.
###Creating a docker image
- Create a "Dockerfile" at your application root containing the following:
FROM meteorhacks/meteord:onbuild
- Build the image. You should customise the organisation and application name.
docker build -t chocolatekiwi/koru .
- Verify the image is available by running "docker images"
The next two sections cater for different situations. If you wish to run your database on the same server as your application read the section "Running with a local container database", otherwise read the section "Running with a remote database".
###Running with a remote database
- Start the application container. You can customise the name. The last part "chocolatekiwi/koru" must match what you decided to use when creating the image. Customise the ROOT_URL and MONGO_URL env vars. If you wish to run on port 80, change "-p 8080:80" to "-p 80:80".
docker run -d --name koru \
-e ROOT_URL=http://dev.wolsey.org \
-e MONGO_URL=mongodb://user:pass@host:port \
-p 8080:80 \
chocolatekiwi/koru
- Visit http://localhost:8080 or http://localhost:80 if you changed the port parameter.
###Running with a local container database
- Start a mongo container. You can customise the name param but if you do you must modify the --link and MONGO_URL params to match in the next step.
docker run -d --name korudb mongo
- Start the application container and link it to the database container. You can customise the name. The last part "chocolatekiwi/koru" must match what you decided to use when creating the image. Customise the ROOT_URL. Do not alter the MONGO_URL as docker takes care of this for us. If you wish to run on port 80, change "-p 8080:80" to "-p 80:80".
docker run -d --name koruapp \
--link korudb:korudb -p 8080:80 \
-e ROOT_URL=http://dev.wolsey.org \
-e MONGO_URL=mongodb://korudb/test \
chocolatekiwi/koru
- Visit http://localhost:8080 or http://localhost:80 if you changed the port parameter.