Skip to content

Commit

Permalink
fix: docker build fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Kei Son authored and heycalmdown committed Aug 30, 2018
1 parent 3a1be66 commit d6263a6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ node_js:

install:
- npm install
- npm run build

script:
- npm test
- npm t

24 changes: 16 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
FROM node:8-alpine
FROM node:10-alpine as build
WORKDIR /app

COPY README.md package.json package-lock.json /app/
RUN npm i --production
RUN npm i

COPY lib /app/lib
# Rarely edited
COPY bin /app/bin
COPY public /app/public
COPY tsconfig.json /app/

COPY bin /app/bin
COPY public /app/public
COPY views /app/views
COPY * /app/
# Frequently edited
COPY views /app/views
COPY src /app/src

EXPOSE 3000
RUN npm run build

RUN npm ci --only=production

FROM node:10-alpine as release
COPY --from=build /app/ /app/

EXPOSE 3000
CMD npm start
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "1.6.0",
"private": true,
"scripts": {
"start": "tsc && node ./bin/www",
"test": "tsc && jasmine lib/spec/**/*.js",
"start": "node ./bin/www",
"build": "tsc",
"test": "jasmine lib/spec/**/*.js",
"commitmsg": "validate-commit-msg",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
"release": "conventional-github-releaser -p angular"
Expand Down

0 comments on commit d6263a6

Please sign in to comment.