blob: 55a7b38dcfb4f4563341454193df022d0eb85e42 [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 Scandolo07c75c52017-04-26 12:11:19 -07004FROM nginx:candidate
Matteo Scandolod819c922016-12-02 14:06:14 -08005
Zack Williams508d2c12017-04-27 20:17:18 -07006# Set environment vars
7ENV CODE_SOURCE .
8ENV CODE_DEST /var/www
9ENV VHOST /var/www/dist
10
11# Install Node.js
12COPY ${CODE_SOURCE}/nodesource.gpg.key /tmp/nodesource.gpg.key
13RUN 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
23COPY ${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}/
29COPY ${CODE_SOURCE}/conf/ ${CODE_DEST}/conf/
30COPY ${CODE_SOURCE}/gulp_tasks/ ${CODE_DEST}/gulp_tasks/
31COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/
32
33# Install deps, build and create logdir
34WORKDIR ${CODE_DEST}
35RUN npm install \
36 && npm run typings \
37 && npm run build \
38 && mkdir -p /var/log/nginx/log
39
40# Override nginx configutaion
41COPY ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf
42
43# expose the app port
44EXPOSE 4000
45
Zack Williamscb3a7b42017-04-15 17:07:18 -070046# Label image
47ARG org_label_schema_schema_version=1.0
48ARG org_label_schema_name=xos-gui
49ARG org_label_schema_version=unknown
50ARG org_label_schema_vcs_url=unknown
51ARG org_label_schema_vcs_ref=unknown
52ARG org_label_schema_build_date=unknown
53ARG org_opencord_vcs_commit_date=unknown
54
55LABEL 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