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 | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 4 | FROM nginx |
| 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 | 9f87f30 | 2016-12-13 18:11:10 -0800 | [diff] [blame] | 30 | RUN apt-get install curl git bzip2 -y |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 31 | RUN curl -sL https://deb.nodesource.com/setup_4.x > install_node.sh |
| 32 | RUN chmod a+x install_node.sh |
| 33 | RUN ./install_node.sh |
| 34 | RUN apt-get install -y nodejs |
| 35 | |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 36 | # Add the app deps |
| 37 | COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/package.json |
| 38 | COPY ${CODE_SOURCE}/typings.json ${CODE_DEST}/typings.json |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 39 | |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 40 | # Install Deps |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 41 | WORKDIR ${CODE_DEST} |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 42 | RUN npm install |
Matteo Scandolo | e1bc8a0 | 2017-01-11 15:35:11 -0800 | [diff] [blame] | 43 | RUN npm run typings |
Matteo Scandolo | d819c92 | 2016-12-02 14:06:14 -0800 | [diff] [blame] | 44 | |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 45 | # Create folder for logs |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 46 | RUN mkdir -p /var/log/nginx/log |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 47 | |
| 48 | # Build the app |
| 49 | EXPOSE 4000 |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 50 | COPY ${CODE_SOURCE}/conf ${CODE_DEST}/conf |
| 51 | COPY ${CODE_SOURCE}/gulp_tasks ${CODE_DEST}/gulp_tasks |
| 52 | COPY ${CODE_SOURCE}/src ${CODE_DEST}/src |
| 53 | COPY ${CODE_SOURCE}/gulpfile.js ${CODE_DEST}/gulpfile.js |
| 54 | COPY ${CODE_SOURCE}/tsconfig.json ${CODE_DEST}/tsconfig.json |
| 55 | COPY ${CODE_SOURCE}/tslint.json ${CODE_DEST}/tslint.json |
| 56 | RUN npm run build |
| 57 | |
| 58 | # Override nginx configutaion |
| 59 | COPY ${CODE_SOURCE}/nginx.conf ${CODE_DEST}/nginx.conf |
| 60 | RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf |