[CORD-2188] Create xos-gui-builder as a shared base image for all the UI containers
Change-Id: I571a50634f1a601ffec838769375761ef760a768
(cherry picked from commit d0e21df39637240d76bc6fcbbc0b7a2484965af1)
diff --git a/Dockerfile b/Dockerfile
index 7894b94..9f39abf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,14 +1,14 @@
# xosproject/xos-gui
-# To build use: docker build -f Dockerfile -t xosproject/xos-gui .
+# To build use: docker build -f Dockerfile -t xosproject/xos-gui:candidate . (note that this require xos-gui-extension-builder to be built)
# To run use: docker run -p 4000:4000 --volumes-from gui-extensions-store -d xosproject/xos-gui
-FROM node:7.9.0 as xos-gui-base
-# Set environment vars
+# xos-gui-base container
+FROM xosproject/xos-gui-builder:candidate as xos-gui-base
+
ENV CODE_SOURCE .
ENV CODE_DEST /var/www
ENV VHOST /var/www/dist
-# copy over files
COPY ${CODE_SOURCE}/package.json \
${CODE_SOURCE}/typings.json \
${CODE_SOURCE}/gulpfile.js \
@@ -19,13 +19,13 @@
COPY ${CODE_SOURCE}/gulp_tasks/ ${CODE_DEST}/gulp_tasks/
COPY ${CODE_SOURCE}/src/ ${CODE_DEST}/src/
-# Install deps and build
WORKDIR ${CODE_DEST}
RUN npm install \
&& npm run typings \
&& npm run build
+# xos-gui container
FROM nginx:candidate
ENV CODE_SOURCE .
@@ -33,19 +33,14 @@
WORKDIR ${VHOST}
-# create logdir
RUN mkdir -p /var/log/nginx/log
-# Override nginx configutaion
COPY ${CODE_SOURCE}/nginx.conf /etc/nginx/conf.d/default.conf
-# Copy minified app
COPY --from=xos-gui-base ${VHOST} .
-# expose the app port
EXPOSE 4000
-# Label image
ARG org_label_schema_schema_version=1.0
ARG org_label_schema_name=xos-gui
ARG org_label_schema_version=unknown