blob: 507433f5149fcf8153371bc884703c64db8fcafe [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 Scandolo60d27152017-04-26 12:11:19 -07004FROM nginx:candidate
Matteo Scandolod819c922016-12-02 14:06:14 -08005
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 Scandolo60d27152017-04-26 12:11:19 -070030RUN apt-get install curl git bzip2 gnupg -y
31RUN curl -sL https://deb.nodesource.com/setup_7.x > node_install.sh
32RUN bash node_install.sh
Matteo Scandolod819c922016-12-02 14:06:14 -080033RUN apt-get install -y nodejs
34
Matteo Scandolo37d65092017-01-12 12:03:05 -080035# Add the app deps
36COPY ${CODE_SOURCE}/package.json ${CODE_DEST}/package.json
37COPY ${CODE_SOURCE}/typings.json ${CODE_DEST}/typings.json
Matteo Scandolod819c922016-12-02 14:06:14 -080038
Matteo Scandolof4b85172017-01-11 09:56:02 -080039# Install Deps
Matteo Scandolod819c922016-12-02 14:06:14 -080040WORKDIR ${CODE_DEST}
Matteo Scandolo37d65092017-01-12 12:03:05 -080041RUN npm install
Matteo Scandoloe1bc8a02017-01-11 15:35:11 -080042RUN npm run typings
Matteo Scandolod819c922016-12-02 14:06:14 -080043
Matteo Scandolo37d65092017-01-12 12:03:05 -080044# Create folder for logs
Matteo Scandolof4b85172017-01-11 09:56:02 -080045RUN mkdir -p /var/log/nginx/log
Matteo Scandolof4b85172017-01-11 09:56:02 -080046
47# Build the app
48EXPOSE 4000
Matteo Scandolo37d65092017-01-12 12:03:05 -080049COPY ${CODE_SOURCE}/conf ${CODE_DEST}/conf
50COPY ${CODE_SOURCE}/gulp_tasks ${CODE_DEST}/gulp_tasks
51COPY ${CODE_SOURCE}/src ${CODE_DEST}/src
52COPY ${CODE_SOURCE}/gulpfile.js ${CODE_DEST}/gulpfile.js
53COPY ${CODE_SOURCE}/tsconfig.json ${CODE_DEST}/tsconfig.json
54COPY ${CODE_SOURCE}/tslint.json ${CODE_DEST}/tslint.json
55RUN npm run build
56
57# Override nginx configutaion
58COPY ${CODE_SOURCE}/nginx.conf ${CODE_DEST}/nginx.conf
59RUN mv ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf