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