1 | FROM node:alpine
|
2 |
|
3 | LABEL name="Mike Erickson"
|
4 | LABEL maintainer="codedungeon@gmail.com"
|
5 |
|
6 | COPY ./docker/.profile /root/.profile
|
7 | COPY ./docker/aliases.sh /root/aliases.sh
|
8 |
|
9 | # create directory in container
|
10 | RUN mkdir -p /usr/code/app
|
11 | WORKDIR /usr/code/app
|
12 |
|
13 | # copy any files necessary for including modules
|
14 | COPY package.json /usr/code/app/
|
15 | COPY yarn.lock /usr/code/app/
|
16 |
|
17 | # install node modules, this should be done with yarn instead
|
18 | RUN yarn install
|
19 |
|
20 | # copy over files to container (node_modules should be ignored as deifned in .dockerignore)
|
21 | COPY . /usr/code/app
|
22 |
|
23 | # this is not required as the container is not hosting any network resoruces
|
24 | # ENV PORT 3000
|
25 | # EXPOSE ${PORT}
|
26 |
|
27 | # kick off the tests
|
28 | CMD [ "yarn","run", "test" ]
|
29 |
|
30 | # run container as follows
|
31 | # make sure to use the -l so it will load profile
|
32 | # docker run --name debug-ci -v$(pwd):/usr/code/app --rm -it dev-node ash -l |
\ | No newline at end of file |