Skip to content

Commit

Permalink
Docker启动
Browse files Browse the repository at this point in the history
  • Loading branch information
csi0n committed Feb 27, 2018
1 parent 5da2192 commit 86142c4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:latest

MAINTAINER csi0n <chqssqll@gmail.com>

RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
echo "deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list && \
echo "deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

ADD . /workspace

WORKDIR /workspace

RUN apt-get update && \
cd ./client && \
npm install && \
npm run build && \
cd ../server && \
npm install && \
npm run build && \
npm install -g pm2

CMD ["pm2-runtime","start","/workspace/server/build","--","mongodb://mongo/scout"]

EXPOSE 3001
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ pm2 start ./server/build mongodb://username:password@host/database
```
然后访问 http://localhost:3001/

### Docker启动
```sh
git clone https://github.com/HandsomeOne/Scout.git

cd Scout/

docker-compose up -d
```

### 升级
```sh
cd Scout
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "2"
services:
web:
build: .
depends_on:
- mongo
ports:
- "3001:3001"
links:
- mongo:mongo
mongo:
image: mongo

0 comments on commit 86142c4

Please sign in to comment.