Zack Williams | ee2e269 | 2017-04-15 17:08:52 -0700 | [diff] [blame^] | 1 | # xosproject/xos-rest-gw |
Matteo Scandolo | f05d8a6 | 2016-12-06 13:36:49 -0800 | [diff] [blame] | 2 | # To build use: docker build -t xosproject/xos-rest-gw . |
| 3 | # 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] | 4 | |
| 5 | FROM node:argon |
| 6 | |
Zack Williams | ee2e269 | 2017-04-15 17:08:52 -0700 | [diff] [blame^] | 7 | # Label image |
| 8 | ARG org_label_schema_schema_version=1.0 |
| 9 | ARG org_label_schema_name=xos-rest-gw |
| 10 | ARG org_label_schema_version=unknown |
| 11 | ARG org_label_schema_vcs_url=unknown |
| 12 | ARG org_label_schema_vcs_ref=unknown |
| 13 | ARG org_label_schema_build_date=unknown |
| 14 | ARG org_opencord_vcs_commit_date=unknown |
| 15 | |
| 16 | LABEL org.label-schema.schema-version=$org_label_schema_schema_version \ |
| 17 | org.label-schema.name=$org_label_schema_name \ |
| 18 | org.label-schema.version=$org_label_schema_version \ |
| 19 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 20 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 21 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 22 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
| 23 | |
Matteo Scandolo | e3ed016 | 2016-12-01 10:09:12 -0800 | [diff] [blame] | 24 | # Set environment variables |
| 25 | ENV CODE_SOURCE . |
| 26 | ENV CODE_DEST /var/www |
| 27 | |
| 28 | # Create app directory |
| 29 | WORKDIR ${CODE_DEST} |
| 30 | |
| 31 | # Install app dependencies |
| 32 | COPY ${CODE_SOURCE}/package.json ${CODE_DEST} |
| 33 | RUN npm install --production |
| 34 | |
| 35 | # Bundle app source |
| 36 | COPY ${CODE_SOURCE}/src ${CODE_DEST}/src |
| 37 | |
| 38 | # Create a folder for logs |
| 39 | RUN mkdir ${CODE_DEST}/logs |
| 40 | |
| 41 | EXPOSE 3000 |
Zack Williams | ee2e269 | 2017-04-15 17:08:52 -0700 | [diff] [blame^] | 42 | CMD [ "npm", "start" ] |