Zack Williams | a13f911 | 2017-04-27 20:16:50 -0700 | [diff] [blame] | 1 | # xosproject/xos-ws |
| 2 | # To build use: docker build -t xosproject/xos-ws . |
| 3 | # To run use: docker run -p 3000:3000 -d xosproject/xos-ws |
Matteo Scandolo | e3ed016 | 2016-12-01 10:09:12 -0800 | [diff] [blame] | 4 | |
Zack Williams | f80d5d0 | 2018-09-28 12:47:20 -0700 | [diff] [blame] | 5 | FROM node:10.11-alpine |
Matteo Scandolo | e3ed016 | 2016-12-01 10:09:12 -0800 | [diff] [blame] | 6 | |
Zack Williams | a13f911 | 2017-04-27 20:16:50 -0700 | [diff] [blame] | 7 | # Set environment variables |
| 8 | ENV CODE_SOURCE . |
| 9 | ENV CODE_DEST /var/www |
| 10 | |
| 11 | # Create app directory |
| 12 | WORKDIR ${CODE_DEST} |
| 13 | |
Zack Williams | ea89ebb | 2018-09-07 12:37:36 -0700 | [diff] [blame] | 14 | # install librdkafka |
| 15 | RUN apk --no-cache add -U python make bash g++ |
| 16 | |
Zack Williams | a13f911 | 2017-04-27 20:16:50 -0700 | [diff] [blame] | 17 | # Copy over app dependencies and source files |
| 18 | COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/ |
| 19 | COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/ |
| 20 | |
| 21 | # Install app dependencies and create logdir |
| 22 | RUN npm install --production \ |
| 23 | && mkdir ${CODE_DEST}/logs |
| 24 | |
| 25 | EXPOSE 3000 |
| 26 | |
Zack Williams | ee2e269 | 2017-04-15 17:08:52 -0700 | [diff] [blame] | 27 | # Label image |
| 28 | ARG org_label_schema_schema_version=1.0 |
| 29 | ARG org_label_schema_name=xos-rest-gw |
| 30 | ARG org_label_schema_version=unknown |
| 31 | ARG org_label_schema_vcs_url=unknown |
| 32 | ARG org_label_schema_vcs_ref=unknown |
| 33 | ARG org_label_schema_build_date=unknown |
| 34 | ARG org_opencord_vcs_commit_date=unknown |
| 35 | |
| 36 | LABEL org.label-schema.schema-version=$org_label_schema_schema_version \ |
| 37 | org.label-schema.name=$org_label_schema_name \ |
| 38 | org.label-schema.version=$org_label_schema_version \ |
| 39 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 40 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 41 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 42 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
| 43 | |
Zack Williams | ee2e269 | 2017-04-15 17:08:52 -0700 | [diff] [blame] | 44 | CMD [ "npm", "start" ] |