Skip to content

Commit

Permalink
clarify dependencies in dev and non-dev environments
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-gru committed Apr 6, 2017
1 parent 2aa8a6d commit 94d171e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,21 @@ RUN mkdir -p /data/db
RUN apt-get install nodejs -y
RUN apt-get install nodejs-legacy -y
RUN apt-get install npm -y
RUN npm install -g nodemon

# install typescript
# for development: auto-restart on changes in backend (nodejs), auto-recompile on changes in frontend (ts->js)
RUN npm install -g nodemon
RUN npm install -g typescript
# install pug
RUN npm install -g pug

# install jshare for sharing node.js variables with client javascript
RUN npm install -g jshare

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app


# Install app dependencies
ADD package.json /usr/src/app/
RUN npm install

# Bundle app source
# file changes in . only lead to a rebuild which triggers only these remaining commands
ADD . /usr/src/app

EXPOSE 8080
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ services:
- .:/usr/src/app
ports:
- "8080:8080"
- "5858:5858"

# as gratefully discovered here: https://github.com/docker/labs/blob/master/developer-tools/nodejs-debugging/VSCode-README.md
- "5858:5858"
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
"main": "course-planner.js",
"scripts": {
"prestart": "mongod --port 27017 --dbpath='/data/db' &",
"start": "mongoimport --db db --collection data --file data.json && nodemon -L /usr/src/app/",
"start": "mongoimport --db db --collection data --file data.json && node /usr/src/app/",
"poststop": "mongod stop"
},
"devDependencies": {
"dependencies": {
"express": "~4.14.0",
"nodemon": "~1.11.0",
"mongoose": "~4.9.2",
"typescript": "~2.2.2",
"pug": "~2.0.0-beta11",
Expand Down

0 comments on commit 94d171e

Please sign in to comment.