From 819d1457e83de155bdc0d5199df174e82f043f3d Mon Sep 17 00:00:00 2001 From: jamiesun Date: Sat, 23 Jul 2016 00:09:31 +0800 Subject: [PATCH 1/3] add docker run script --- runclub | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 runclub diff --git a/runclub b/runclub new file mode 100644 index 0000000000..631de0b2c0 --- /dev/null +++ b/runclub @@ -0,0 +1,9 @@ +#!/bin/sh + +cd /opt/nodeclub + +git pull origin master + +test -f /opt/nodeclub/config.js || cp /etc/nodeclub/config.js /opt/nodeclub/config.js + +node app.js From 0eb2a97a2b2d05ba55badce88eab8d1612a27759 Mon Sep 17 00:00:00 2001 From: jamiesun Date: Sat, 23 Jul 2016 00:13:54 +0800 Subject: [PATCH 2/3] Create Dockerfile --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..b76069970c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM centos:centos7 +MAINTAINER jamiesun + +RUN yum update -y +RUN yum install -y epel-release +RUN yum install -y gcc make git nodejs npm openssl openssl-devel zip unzip libjpeg-devel libpng-devel +RUN yum clean all + +RUN npm install -g n && n stable + +RUN git clone -b master https://github.com/cnodejs/nodeclub.git /opt/nodeclub +RUN cd /opt/nodeclub && make install && make build + +ADD runclub /usr/local/bin/runclub +RUN chmod +x /usr/local/bin/runclub + +EXPOSE 3000 + +CMD ["/usr/local/bin/runclub"] From b2099f75af57da03087b5c46075c1ec3281ccd90 Mon Sep 17 00:00:00 2001 From: jamiesun Date: Sat, 23 Jul 2016 00:17:33 +0800 Subject: [PATCH 3/3] add etc VOLUME --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index b76069970c..b1cea01840 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM centos:centos7 MAINTAINER jamiesun +VOLUME [ "/etc/nodeclub" ] + RUN yum update -y RUN yum install -y epel-release RUN yum install -y gcc make git nodejs npm openssl openssl-devel zip unzip libjpeg-devel libpng-devel