Matteo Scandolo | f05d8a6 | 2016-12-06 13:36:49 -0800 | [diff] [blame] | 1 | # To build use: docker build -t xosproject/xos-rest-gw . |
| 2 | # To run use: docker run -p 3000:3000 -d xosproject/xos-rest-gw |
Matteo Scandolo | e3ed016 | 2016-12-01 10:09:12 -0800 | [diff] [blame] | 3 | |
| 4 | FROM node:argon |
| 5 | |
| 6 | # Set environment variables |
| 7 | ENV CODE_SOURCE . |
| 8 | ENV CODE_DEST /var/www |
| 9 | |
| 10 | # Create app directory |
| 11 | WORKDIR ${CODE_DEST} |
| 12 | |
| 13 | # Install app dependencies |
| 14 | COPY ${CODE_SOURCE}/package.json ${CODE_DEST} |
| 15 | RUN npm install --production |
| 16 | |
| 17 | # Bundle app source |
| 18 | COPY ${CODE_SOURCE}/src ${CODE_DEST}/src |
| 19 | |
| 20 | # Create a folder for logs |
| 21 | RUN mkdir ${CODE_DEST}/logs |
| 22 | |
| 23 | EXPOSE 3000 |
| 24 | CMD [ "npm", "start" ] |