Illyoung Choi | 59820ed | 2019-06-24 17:01:00 -0700 | [diff] [blame^] | 1 | # opencord/cord-workflow-control-service |
| 2 | # To build use: docker build -t opencord/cord-workflow-control-service . |
| 3 | # To run use: docker run -p 3000:3000 -d opencord/cord-workflow-control-service |
| 4 | |
| 5 | FROM node:10.16-alpine |
| 6 | |
| 7 | # Set environment variables |
| 8 | ENV CODE_SOURCE . |
| 9 | ENV CODE_DEST /var/www |
| 10 | |
| 11 | # Create app directory |
| 12 | WORKDIR ${CODE_DEST} |
| 13 | |
| 14 | # install librdkafka |
| 15 | RUN apk --no-cache add -U python make bash g++ |
| 16 | |
| 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 | |
| 27 | # Label image |
| 28 | ARG org_label_schema_schema_version=1.0 |
| 29 | ARG org_label_schema_name=cord-workflow-controller |
| 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 | |
| 44 | CMD [ "npm", "start" ] |