From 7e8d55dca97514007d32a5c14b4a28669ce17438 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 16:23:25 +0200 Subject: [PATCH 1/7] Dockerfile --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..beaee75 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:6.2.2 + +COPY package.json / +RUN npm install -g astrum + +RUN mkdir /app +WORKDIR /app + +ENTRYPOINT ["/usr/local/lib/node_modules/astrum/manager/astrum.js"] From 8bf74faaf5352afa99b827f8be4880fd9aa18a3d Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 16:29:11 +0200 Subject: [PATCH 2/7] updated Readme --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index a8583d5..a4746c0 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ You also have the option to add pages of content, for example an introduction pa - [Deleting Components](#deleting-components) - [Deleting Groups](#deleting-groups) - [Updating Astrum](#updating-astrum) +- [Docker](#docker) - [Contributing](#contributing) - [Browser Support](#browser-support) - [Acknowledgements](#acknowledgements) @@ -420,6 +421,22 @@ Navigate to the route of your project and then update your Astrum instance e.g.: You will receive feedback that the update is complete. + + +To build the docker image: + +`docker build -t you/astrum .` + +Then to use it: + +`docker run -it --rm -v /path-to-your-application:/data test/astrum init ./public/pattern-library` + +As you can see, you don't need to specify the `astrum` binary, as is configured +to be the entrypoint of docker container. + +It is important to mount the local volumes to `/data` as is the base working dir. + + ## Contributing Astrum was created by Ryan Taylor & Matt West of [No Divide](http://nodividestudio.com). We welcome anyone and everyone to contribute to the project and help us make Astrum as versatile as possible. If you decide to get involved, please take a moment to review our [contribution guidelines](CONTRIBUTING.md): From 2cc4e79b88906a5cf8e47d99855ca2062639aae0 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 16:31:47 +0200 Subject: [PATCH 3/7] updated Readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a4746c0..9c8444b 100644 --- a/README.md +++ b/README.md @@ -436,6 +436,13 @@ to be the entrypoint of docker container. It is important to mount the local volumes to `/data` as is the base working dir. +You can use Docker also to run the generated applications, using a webserver +like nginx: + +`docker run -d -v /path-to-your-application/public/pattern-library:/usr/share/nginx/html:ro -p 8080:80 nginx:latest` + +Then you can access it on: `http://localhost:8080` + ## Contributing From 037a7cc094b4e1ae54d6daaf71912545b0b949d8 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 16:33:39 +0200 Subject: [PATCH 4/7] updated Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index beaee75..df3ad2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:6.2.2 -COPY package.json / -RUN npm install -g astrum +COPY . /node +RUN cd /node && npm install -g astrum RUN mkdir /app WORKDIR /app From 3b3ea5fdc87ace4130ae5a5dd6d70dbd0f773c67 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 18:31:17 +0200 Subject: [PATCH 5/7] fix type docker image name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c8444b..9c9e86b 100644 --- a/README.md +++ b/README.md @@ -429,7 +429,7 @@ To build the docker image: Then to use it: -`docker run -it --rm -v /path-to-your-application:/data test/astrum init ./public/pattern-library` +`docker run -it --rm -v /path-to-your-application:/data you/astrum init ./public/pattern-library` As you can see, you don't need to specify the `astrum` binary, as is configured to be the entrypoint of docker container. From d8c7d7ee059a13d9b39f5992e06e36b9767c8762 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 19:20:42 +0200 Subject: [PATCH 6/7] fix typo volume path --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c9e86b..5ddb49b 100644 --- a/README.md +++ b/README.md @@ -429,12 +429,12 @@ To build the docker image: Then to use it: -`docker run -it --rm -v /path-to-your-application:/data you/astrum init ./public/pattern-library` +`docker run -it --rm -v /path-to-your-application:/app you/astrum init ./public/pattern-library` As you can see, you don't need to specify the `astrum` binary, as is configured to be the entrypoint of docker container. -It is important to mount the local volumes to `/data` as is the base working dir. +It is important to mount the local volumes to `/app` as is the base working dir. You can use Docker also to run the generated applications, using a webserver like nginx: From 1e7554f7c42810b9971d38c9ff3709b1711b7125 Mon Sep 17 00:00:00 2001 From: Paolo Mainardi Date: Tue, 5 Jul 2016 20:01:45 +0200 Subject: [PATCH 7/7] hint alias --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5ddb49b..523ba30 100644 --- a/README.md +++ b/README.md @@ -431,6 +431,10 @@ Then to use it: `docker run -it --rm -v /path-to-your-application:/app you/astrum init ./public/pattern-library` +*Hint* You can always set an alias to make it more compact: + +`alias astrum="docker run -it --rm -v $PWD:/app test/astrum"` + As you can see, you don't need to specify the `astrum` binary, as is configured to be the entrypoint of docker container. @@ -441,6 +445,8 @@ like nginx: `docker run -d -v /path-to-your-application/public/pattern-library:/usr/share/nginx/html:ro -p 8080:80 nginx:latest` + + Then you can access it on: `http://localhost:8080`