[CORD-2188] Create xos-gui-builder as a shared base image for all the UI containers
Change-Id: I571a50634f1a601ffec838769375761ef760a768
diff --git a/.dockerignore b/.dockerignore
index 93f1361..86ee3aa 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,2 +1,8 @@
node_modules
+typings
+coverage
+generator-xos-gui-extension
+docs
+.tmp
+.idea
npm-debug.log
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
diff --git a/Dockerfile.xos-gui-extension-builder b/Dockerfile.xos-gui-builder
similarity index 92%
rename from Dockerfile.xos-gui-extension-builder
rename to Dockerfile.xos-gui-builder
index 4e1a8e6..93d4fa5 100644
--- a/Dockerfile.xos-gui-extension-builder
+++ b/Dockerfile.xos-gui-builder
@@ -14,7 +14,7 @@
# limitations under the License.
-# To build use: docker build -t xosproject/xos-gui-extension-builder .
+# To build use: docker build -t xosproject/xos-gui-builder:candidate .
FROM node:7.9.0
@@ -24,15 +24,12 @@
RUN mkdir -p ${CODE_DEST}
-# Add the app deps
COPY ${CODE_SOURCE}/package.json ${CODE_SOURCE}/typings.json ${CODE_DEST}/
-# Install Deps
WORKDIR ${CODE_DEST}
RUN npm install \
&& npm run typings
-# Label image
ARG org_label_schema_schema_version=1.0
ARG org_label_schema_name=xos-gui-extension-builder
ARG org_label_schema_version=unknown