don't install coffeescript in runtime image

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
This commit is contained in:
Petros Angelatos 2016-07-06 01:47:48 -07:00
parent ca91fd179b
commit fd44a92782
2 changed files with 11 additions and 6 deletions

View File

@ -14,8 +14,7 @@ RUN apt-get update \
python \
rsync \
wget \
&& rm -rf /var/lib/apt/lists/ \
&& npm install -g coffee-script
&& rm -rf /var/lib/apt/lists/
ENV DOCKER_COMPOSE_VERSION 1.7.1
@ -41,12 +40,17 @@ RUN set -x \
COPY package.json /usr/src/app/
RUN JOBS=MAX npm install --unsafe-perm --production --no-optional \
&& npm dedupe
# First install devDependencies too in order to run the build
RUN JOBS=MAX npm install --unsafe-perm
COPY src /usr/src/app/src
RUN coffee -c src
RUN npm run build
# Re-install just production modules. This should be fast due to npm cache from previous layer
RUN rm -rf node_modules \
&& JOBS=MAX npm install --unsafe-perm --production --no-optional \
&& npm dedupe
# Remove various uneeded filetypes in order to reduce space
RUN find . -path '*/coverage/*' -o -path '*/test/*' -o -path '*/.nyc_output/*' \

View File

@ -3,6 +3,7 @@
"version": "2.1.1",
"scripts": {
"start": "./entry.sh",
"build": "coffee -c src",
"lint": "resin-lint src/"
},
"dependencies": {
@ -11,7 +12,6 @@
"bluebird": "^2.9.24",
"body-parser": "^1.12.0",
"buffer-equal-constant-time": "^1.0.1",
"coffee-script": "~1.10.0",
"docker-delta": "0.0.11",
"docker-progress": "^2.1.0",
"docker-toolbelt": "^1.0.0",
@ -40,6 +40,7 @@
"node": "0.10.22"
},
"devDependencies": {
"coffee-script": "~1.10.0",
"resin-lint": "^1.3.1"
}
}