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 | cb3a7b4 | 2017-04-15 17:07:18 -0700 | [diff] [blame] | 6 | # Label image |
| 7 | ARG org_label_schema_schema_version=1.0 |
| 8 | ARG org_label_schema_name=xos-gui |
| 9 | ARG org_label_schema_version=unknown |
| 10 | ARG org_label_schema_vcs_url=unknown |
| 11 | ARG org_label_schema_vcs_ref=unknown |
| 12 | ARG org_label_schema_build_date=unknown |
| 13 | ARG org_opencord_vcs_commit_date=unknown |
| 14 | |
| 15 | LABEL org.label-schema.schema-version=$org_label_schema_schema_version \ |
| 16 | org.label-schema.name=$org_label_schema_name \ |
| 17 | org.label-schema.version=$org_label_schema_version \ |
| 18 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 19 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 20 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 21 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |
| 22 | |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 23 | # Set environment vars |
| 24 | ENV CODE_SOURCE . |
| 25 | ENV CODE_DEST /var/www |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 26 | ENV VHOST /var/www/dist |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 27 | |
| 28 | # Install nodeJs |
| 29 | RUN apt-get update |
Matteo Scandolo | 60d2715 | 2017-04-26 12:11:19 -0700 | [diff] [blame] | 30 | RUN apt-get install curl git bzip2 gnupg -y |
| 31 | RUN curl -sL https://deb.nodesource.com/setup_7.x > node_install.sh |
| 32 | RUN bash node_install.sh |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 33 | RUN apt-get install -y nodejs |
| 34 | |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 35 | # Add the app deps |
| 36 | COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/package.json |
| 37 | COPY ${CODE_SOURCE}/typings.json ${CODE_DEST}/typings.json |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 38 | |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 39 | # Install Deps |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 40 | WORKDIR ${CODE_DEST} |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 41 | RUN npm install |
Matteo Scandolo | e1bc8a0 | 2017-01-11 15:35:11 -0800 | [diff] [blame] | 42 | RUN npm run typings |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 43 | |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 44 | # Create folder for logs |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 45 | RUN mkdir -p /var/log/nginx/log |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 46 | |
| 47 | # Build the app |
| 48 | EXPOSE 4000 |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 49 | COPY ${CODE_SOURCE}/conf ${CODE_DEST}/conf |
| 50 | COPY ${CODE_SOURCE}/gulp_tasks ${CODE_DEST}/gulp_tasks |
| 51 | COPY ${CODE_SOURCE}/src ${CODE_DEST}/src |
| 52 | COPY ${CODE_SOURCE}/gulpfile.js ${CODE_DEST}/gulpfile.js |
| 53 | COPY ${CODE_SOURCE}/tsconfig.json ${CODE_DEST}/tsconfig.json |
| 54 | COPY ${CODE_SOURCE}/tslint.json ${CODE_DEST}/tslint.json |
| 55 | RUN npm run build |
| 56 | |
| 57 | # Override nginx configutaion |
| 58 | COPY ${CODE_SOURCE}/nginx.conf ${CODE_DEST}/nginx.conf |
| 59 | RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf |