blob: 30658448a1dc6936da53b58b46a0ce03b9e0f642 [file] [log] [blame]
Zack Williamscb3a7b42017-04-15 17:07:18 -07001# xosproject/xos-gui
Matteo Scandolod819c922016-12-02 14:06:14 -08002# To build use: docker build -t xosproject/xos-gui .
Matteo Scandolo11b4a632017-02-09 10:28:41 -08003# To run use: docker run -p 4000:4000 --volumes-from gui-extensions-store -d xosproject/xos-gui
Matteo Scandolod819c922016-12-02 14:06:14 -08004FROM nginx
5
Zack Williamscb3a7b42017-04-15 17:07:18 -07006# Label image
7ARG org_label_schema_schema_version=1.0
8ARG org_label_schema_name=xos-gui
9ARG org_label_schema_version=unknown
10ARG org_label_schema_vcs_url=unknown
11ARG org_label_schema_vcs_ref=unknown
12ARG org_label_schema_build_date=unknown
13ARG org_opencord_vcs_commit_date=unknown
14
15LABEL 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 Scandolod819c922016-12-02 14:06:14 -080023# Set environment vars
24ENV CODE_SOURCE .
25ENV CODE_DEST /var/www
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -080026ENV VHOST /var/www/dist
Matteo Scandolod819c922016-12-02 14:06:14 -080027
28# Install nodeJs
29RUN apt-get update
Matteo Scandolo9f87f302016-12-13 18:11:10 -080030RUN apt-get install curl git bzip2 -y
Matteo Scandolod819c922016-12-02 14:06:14 -080031RUN curl -sL https://deb.nodesource.com/setup_4.x > install_node.sh
32RUN chmod a+x install_node.sh
33RUN ./install_node.sh
34RUN apt-get install -y nodejs
35
Matteo Scandolo37d65092017-01-12 12:03:05 -080036# Add the app deps
37COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/package.json
38COPY ${CODE_SOURCE}/typings.json ${CODE_DEST}/typings.json
Matteo Scandolod819c922016-12-02 14:06:14 -080039
Matteo Scandolof4b85172017-01-11 09:56:02 -080040# Install Deps
Matteo Scandolod819c922016-12-02 14:06:14 -080041WORKDIR ${CODE_DEST}
Matteo Scandolo37d65092017-01-12 12:03:05 -080042RUN npm install
Matteo Scandoloe1bc8a02017-01-11 15:35:11 -080043RUN npm run typings
Matteo Scandolod819c922016-12-02 14:06:14 -080044
Matteo Scandolo37d65092017-01-12 12:03:05 -080045# Create folder for logs
Matteo Scandolof4b85172017-01-11 09:56:02 -080046RUN mkdir -p /var/log/nginx/log
Matteo Scandolof4b85172017-01-11 09:56:02 -080047
48# Build the app
49EXPOSE 4000
Matteo Scandolo37d65092017-01-12 12:03:05 -080050COPY ${CODE_SOURCE}/conf ${CODE_DEST}/conf
51COPY ${CODE_SOURCE}/gulp_tasks ${CODE_DEST}/gulp_tasks
52COPY ${CODE_SOURCE}/src ${CODE_DEST}/src
53COPY ${CODE_SOURCE}/gulpfile.js ${CODE_DEST}/gulpfile.js
54COPY ${CODE_SOURCE}/tsconfig.json ${CODE_DEST}/tsconfig.json
55COPY ${CODE_SOURCE}/tslint.json ${CODE_DEST}/tslint.json
56RUN npm run build
57
58# Override nginx configutaion
59COPY ${CODE_SOURCE}/nginx.conf ${CODE_DEST}/nginx.conf
60RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf