Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加 Docker 部署支持 #868

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM centos:centos7
MAINTAINER jamiesun <jamiesun.net@gmail.com>

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
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"]
9 changes: 9 additions & 0 deletions runclub
Original file line number Diff line number Diff line change
@@ -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