blob: 7894b940f04ad8cc79a928da5d3f06a6ed030f72 [file] [log] [blame]
Zack Williamscb3a7b42017-04-15 17:07:18 -07001# xosproject/xos-gui
Matteo Scandolocd9002a2017-10-31 10:07:40 +01002# To build use: docker build -f Dockerfile -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 Scandolocd9002a2017-10-31 10:07:40 +01004FROM node:7.9.0 as xos-gui-base
Matteo Scandolod819c922016-12-02 14:06:14 -08005
Zack Williamsca68f352017-04-27 20:17:18 -07006# Set environment vars
7ENV CODE_SOURCE .
8ENV CODE_DEST /var/www
9ENV VHOST /var/www/dist
10
Zack Williamsca68f352017-04-27 20:17:18 -070011# copy over files
12COPY ${CODE_SOURCE}/package.json \
13 ${CODE_SOURCE}/typings.json \
14 ${CODE_SOURCE}/gulpfile.js \
15 ${CODE_SOURCE}/tsconfig.json \
16 ${CODE_SOURCE}/tslint.json \
17 ${CODE_DEST}/
18COPY ${CODE_SOURCE}/conf/ ${CODE_DEST}/conf/
19COPY ${CODE_SOURCE}/gulp_tasks/ ${CODE_DEST}/gulp_tasks/
20COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/
21
Matteo Scandolocd9002a2017-10-31 10:07:40 +010022# Install deps and build
Zack Williamsca68f352017-04-27 20:17:18 -070023WORKDIR ${CODE_DEST}
24RUN npm install \
25 && npm run typings \
Matteo Scandolocd9002a2017-10-31 10:07:40 +010026 && npm run build
27
28
29FROM nginx:candidate
30
31ENV CODE_SOURCE .
32ENV VHOST /var/www/dist
33
34WORKDIR ${VHOST}
35
36# create logdir
37RUN mkdir -p /var/log/nginx/log
Zack Williamsca68f352017-04-27 20:17:18 -070038
39# Override nginx configutaion
40COPY ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf
41
Matteo Scandolocd9002a2017-10-31 10:07:40 +010042# Copy minified app
43COPY --from=xos-gui-base ${VHOST} .
44
Zack Williamsca68f352017-04-27 20:17:18 -070045# expose the app port
46EXPOSE 4000
47
Zack Williamscb3a7b42017-04-15 17:07:18 -070048# Label image
49ARG org_label_schema_schema_version=1.0
50ARG org_label_schema_name=xos-gui
51ARG org_label_schema_version=unknown
52ARG org_label_schema_vcs_url=unknown
53ARG org_label_schema_vcs_ref=unknown
54ARG org_label_schema_build_date=unknown
55ARG org_opencord_vcs_commit_date=unknown
56
57LABEL org.label-schema.schema-version=$org_label_schema_schema_version \
58 org.label-schema.name=$org_label_schema_name \
59 org.label-schema.version=$org_label_schema_version \
60 org.label-schema.vcs-url=$org_label_schema_vcs_url \
61 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
62 org.label-schema.build-date=$org_label_schema_build_date \
63 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date
64