Zack Williams | cb3a7b4 | 2017-04-15 17:07:18 -0700 | [diff] [blame] | 1 | # xosproject/xos-gui |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 2 | # To build use: docker build -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 | 60d2715 | 2017-04-26 12:11:19 -0700 | [diff] [blame] | 4 | FROM nginx:candidate |
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 | |
| 11 | # Install Node.js |
| 12 | COPY ${CODE_SOURCE}/nodesource.gpg.key /tmp/nodesource.gpg.key |
| 13 | RUN apt-get update \ |
| 14 | && apt-get install -y gnupg apt-transport-https \ |
| 15 | && apt-key add /tmp/nodesource.gpg.key \ |
| 16 | && echo "deb https://deb.nodesource.com/node_7.x trusty main" \ |
| 17 | > /etc/apt/sources.list.d/nodesource.list \ |
| 18 | && apt-get update \ |
| 19 | && apt-get install -y curl git bzip2 nodejs \ |
| 20 | && rm -rf /var/lib/apt/lists/* |
| 21 | |
| 22 | # copy over files |
| 23 | COPY ${CODE_SOURCE}/package.json \ |
| 24 | ${CODE_SOURCE}/typings.json \ |
| 25 | ${CODE_SOURCE}/gulpfile.js \ |
| 26 | ${CODE_SOURCE}/tsconfig.json \ |
| 27 | ${CODE_SOURCE}/tslint.json \ |
| 28 | ${CODE_DEST}/ |
| 29 | COPY ${CODE_SOURCE}/conf/ ${CODE_DEST}/conf/ |
| 30 | COPY ${CODE_SOURCE}/gulp_tasks/ ${CODE_DEST}/gulp_tasks/ |
| 31 | COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/ |
| 32 | |
| 33 | # Install deps, build and create logdir |
| 34 | WORKDIR ${CODE_DEST} |
| 35 | RUN npm install \ |
| 36 | && npm run typings \ |
| 37 | && npm run build \ |
| 38 | && mkdir -p /var/log/nginx/log |
| 39 | |
| 40 | # Override nginx configutaion |
| 41 | COPY ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf |
| 42 | |
| 43 | # expose the app port |
| 44 | EXPOSE 4000 |
| 45 | |
Zack Williams | cb3a7b4 | 2017-04-15 17:07:18 -0700 | [diff] [blame] | 46 | # Label image |
| 47 | ARG org_label_schema_schema_version=1.0 |
| 48 | ARG org_label_schema_name=xos-gui |
| 49 | ARG org_label_schema_version=unknown |
| 50 | ARG org_label_schema_vcs_url=unknown |
| 51 | ARG org_label_schema_vcs_ref=unknown |
| 52 | ARG org_label_schema_build_date=unknown |
| 53 | ARG org_opencord_vcs_commit_date=unknown |
| 54 | |
| 55 | LABEL org.label-schema.schema-version=$org_label_schema_schema_version \ |
| 56 | org.label-schema.name=$org_label_schema_name \ |
| 57 | org.label-schema.version=$org_label_schema_version \ |
| 58 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 59 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 60 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 61 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
| 62 | |