diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0fee92c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/frontend"] + path = src/frontend + url = https://github.com/avatao-content/tutorial-framework-ng diff --git a/Dockerfile b/Dockerfile index 8e57e43..d006b62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,11 @@ +FROM node:9 as ngbuild + +WORKDIR /data/ + +COPY src/frontend /data/ +RUN yarn install --frozen-lockfile +RUN yarn build --no-progress + FROM avatao/ubuntu:16.04 # Install dependencies @@ -50,7 +58,7 @@ ENV TFW_EVENT_HANDLERS_DIR="/opt/event_handlers" COPY src/event_handlers ${TFW_EVENT_HANDLERS_DIR} ENV TFW_FRONTEND_DIR="/srv/frontend" -COPY src/frontend/dist ${TFW_FRONTEND_DIR} +COPY --from=ngbuild /data/dist ${TFW_FRONTEND_DIR} ENV TFW_PUBLIC_PORT=8888 EXPOSE ${TFW_PUBLIC_PORT} diff --git a/src/frontend b/src/frontend new file mode 160000 index 0000000..1af4333 --- /dev/null +++ b/src/frontend @@ -0,0 +1 @@ +Subproject commit 1af4333347abcd107e5a9905ec25a3355a9e776d