Zack Williams | cb3a7b4 | 2017-04-15 17:07:18 -0700 | [diff] [blame] | 1 | # xosproject/xos-gui |
Matteo Scandolo | cd9002a | 2017-10-31 10:07:40 +0100 | [diff] [blame^] | 2 | # To build use: docker build -f Dockerfile -t xosproject/xos-gui . |
Matteo Scandolo | 11b4a63 | 2017-02-09 10:28:41 -0800 | [diff] [blame] | 3 | # To run use: docker run -p 4000:4000 --volumes-from gui-extensions-store -d xosproject/xos-gui |
Matteo Scandolo | cd9002a | 2017-10-31 10:07:40 +0100 | [diff] [blame^] | 4 | FROM node:7.9.0 as xos-gui-base |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 5 | |
Zack Williams | ca68f35 | 2017-04-27 20:17:18 -0700 | [diff] [blame] | 6 | # Set environment vars |
| 7 | ENV CODE_SOURCE . |
| 8 | ENV CODE_DEST /var/www |
| 9 | ENV VHOST /var/www/dist |
| 10 | |
Zack Williams | ca68f35 | 2017-04-27 20:17:18 -0700 | [diff] [blame] | 11 | # copy over files |
| 12 | COPY ${CODE_SOURCE}/package.json \ |
| 13 | ${CODE_SOURCE}/typings.json \ |
| 14 | ${CODE_SOURCE}/gulpfile.js \ |
| 15 | ${CODE_SOURCE}/tsconfig.json \ |
| 16 | ${CODE_SOURCE}/tslint.json \ |
| 17 | ${CODE_DEST}/ |
| 18 | COPY ${CODE_SOURCE}/conf/ ${CODE_DEST}/conf/ |
| 19 | COPY ${CODE_SOURCE}/gulp_tasks/ ${CODE_DEST}/gulp_tasks/ |
| 20 | COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/ |
| 21 | |
Matteo Scandolo | cd9002a | 2017-10-31 10:07:40 +0100 | [diff] [blame^] | 22 | # Install deps and build |
Zack Williams | ca68f35 | 2017-04-27 20:17:18 -0700 | [diff] [blame] | 23 | WORKDIR ${CODE_DEST} |
| 24 | RUN npm install \ |
| 25 | && npm run typings \ |
Matteo Scandolo | cd9002a | 2017-10-31 10:07:40 +0100 | [diff] [blame^] | 26 | && npm run build |
| 27 | |
| 28 | |
| 29 | FROM nginx:candidate |
| 30 | |
| 31 | ENV CODE_SOURCE . |
| 32 | ENV VHOST /var/www/dist |
| 33 | |
| 34 | WORKDIR ${VHOST} |
| 35 | |
| 36 | # create logdir |
| 37 | RUN mkdir -p /var/log/nginx/log |
Zack Williams | ca68f35 | 2017-04-27 20:17:18 -0700 | [diff] [blame] | 38 | |
| 39 | # Override nginx configutaion |
| 40 | COPY ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf |
| 41 | |
Matteo Scandolo | cd9002a | 2017-10-31 10:07:40 +0100 | [diff] [blame^] | 42 | # Copy minified app |
| 43 | COPY --from=xos-gui-base ${VHOST} . |
| 44 | |
Zack Williams | ca68f35 | 2017-04-27 20:17:18 -0700 | [diff] [blame] | 45 | # expose the app port |
| 46 | EXPOSE 4000 |
| 47 | |
Zack Williams | cb3a7b4 | 2017-04-15 17:07:18 -0700 | [diff] [blame] | 48 | # Label image |
| 49 | ARG org_label_schema_schema_version=1.0 |
| 50 | ARG org_label_schema_name=xos-gui |
| 51 | ARG org_label_schema_version=unknown |
| 52 | ARG org_label_schema_vcs_url=unknown |
| 53 | ARG org_label_schema_vcs_ref=unknown |
| 54 | ARG org_label_schema_build_date=unknown |
| 55 | ARG org_opencord_vcs_commit_date=unknown |
| 56 | |
| 57 | LABEL org.label-schema.schema-version=$org_label_schema_schema_version \ |
| 58 | org.label-schema.name=$org_label_schema_name \ |
| 59 | org.label-schema.version=$org_label_schema_version \ |
| 60 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 61 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 62 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 63 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
| 64 | |