]>
Commit | Line | Data |
---|---|---|
6b631422 | 1 | FROM node:6.9 |
53e8df40 PK |
2 | MAINTAINER Paris Kasidiaris <paris@sourcelair.com> |
3 | ||
6b631422 AK |
4 | # Set the working directory |
5 | WORKDIR /usr/src/app | |
6 | ||
7 | # Set an entrypoint, to automatically install node modules | |
61c213f9 | 8 | ENTRYPOINT ["/bin/bash", "-c", "if [[ ! -d node_modules ]]; then npm install; fi; exec \"${@:0}\";"] |
b2e257bf | 9 | CMD ["npm", "run", "dev"] |
6b631422 AK |
10 | |
11 | # First, install dependencies to improve layer caching | |
12 | COPY package.json /usr/src/app/ | |
13 | RUN npm install | |
14 | ||
15 | # Add the code | |
16 | COPY . /usr/src/app | |
17 | ||
18 | # Run the tests and build, to make sure everything is working nicely | |
61c213f9 | 19 | RUN npm run build && npm run test |