Skip to content

Commit cfa396b

Browse files
authored
Merge pull request icebob#69 from drginm/feature/docker
Docker configurations
2 parents 282c8e7 + 5f66df2 commit cfa396b

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
npm-debug.log

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:6.11
2+
3+
# Create app directory
4+
WORKDIR /usr/src/app
5+
6+
# Install app dependencies
7+
COPY package.json .
8+
9+
RUN npm install
10+
11+
# Bundle app source
12+
COPY . .
13+
14+
EXPOSE 3000

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ For production
8686
$ npm start
8787
```
8888

89+
## Docker
90+
91+
Building the images for the first time
92+
```
93+
$ docker-compose build
94+
```
95+
96+
Starting the images
97+
```
98+
$ docker-compose up
99+
```
100+
89101
## Screenshots
90102

91103
### Login screen

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '3'
2+
services:
3+
web:
4+
image: vue-express-mongo-site
5+
build: .
6+
command: npm run docker-dev
7+
ports:
8+
- "3000:3000"
9+
volumes:
10+
- .:/usr/src/app
11+
- /usr/src/app/node_modules
12+
depends_on:
13+
- "mongo"
14+
mongo:
15+
image: "mongo"
16+
17+
ports:
18+
- "27017:27017"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"build": "webpack --progress --colors --config build/webpack.prod.config.js",
99
"build:server": "webpack --progress --colors --config build/webpack.server.config.js",
1010
"dev": "cross-env NODE_ENV=development nodemon --debug",
11+
"docker-dev": "cross-env NODE_ENV=development MONGO_URI=mongodb://mongo/ nodemon --debug",
1112
"start": "cross-env NODE_ENV=production node server/index.js",
1213
"start:bundle": "cross-env NODE_ENV=production node server/bundle.js",
1314
"start:cluster": "cross-env NODE_ENV=production node cluster.js",

0 commit comments

Comments
 (0)