From c6f42aeaf6b677db6a3f6c0749941c8b3b07f88b Mon Sep 17 00:00:00 2001 From: cgu Date: Fri, 4 Dec 2020 17:10:24 -0500 Subject: [PATCH 1/3] Add docker to docs site --- Makefile | 8 ++------ docs_website/Dockerfile | 10 ++++++++++ docs_website/docker-compose.yml | 13 +++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 docs_website/Dockerfile create mode 100644 docs_website/docker-compose.yml diff --git a/Makefile b/Makefile index 07f97247a..a4df614db 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ SHELL := /bin/bash +.PHONY: bundled_off prod_web prod_worker prod_scheduler docs remove_running_dev_image clean bundled: dev_image docker-compose up @@ -18,7 +19,6 @@ scheduler: dev_image terminal: dev_image docker-compose -f containers/docker-compose.dev.yml run terminal - prod_web: docker-compose -f containers/docker-compose.prod.yml run web @@ -34,13 +34,9 @@ prod_image: dev_image: docker build --pull -t datahub-dev . --build-arg PRODUCTION=false -docs: docs_image +docs: docker-compose -f docs_website/docker-compose.yml --project-directory=. up -docs_image: - docker build --file docs_website/Dockerfile -t docusaurus-doc . - - install: make install_pip_runtime_dependencies make install_yarn_packages diff --git a/docs_website/Dockerfile b/docs_website/Dockerfile new file mode 100644 index 000000000..5494abee3 --- /dev/null +++ b/docs_website/Dockerfile @@ -0,0 +1,10 @@ +FROM node:14 + +WORKDIR /opt/docs_website +COPY docs_website/package.json . +COPY docs_website/yarn.lock . +RUN yarn install +COPY docs_website/ /opt/docs_website +COPY docs /opt/docs + +ENTRYPOINT yarn start --port ${PORT} diff --git a/docs_website/docker-compose.yml b/docs_website/docker-compose.yml new file mode 100644 index 000000000..dae6367d3 --- /dev/null +++ b/docs_website/docker-compose.yml @@ -0,0 +1,13 @@ +version: '2.1' + +# volumes: +# node_modules: +services: + docs: + build: + context: . + dockerfile: ./docs_website/Dockerfile + container_name: datahub_docs + network_mode: 'host' + environment: + PORT: ${PORT:-3000} From e60a471cc15425f456517bc59c8c697f39f37a4d Mon Sep 17 00:00:00 2001 From: cgu Date: Fri, 4 Dec 2020 17:27:40 -0500 Subject: [PATCH 2/3] Use prod build, force build on make --- .gitignore | 2 +- Makefile | 2 +- docs_website/Dockerfile | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 146163bc1..a9451baad 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,4 @@ datahub/webapp/coverage/ # Documentation site .docusaurus .cache-loader -/build +build diff --git a/Makefile b/Makefile index a4df614db..925e8affc 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ dev_image: docker build --pull -t datahub-dev . --build-arg PRODUCTION=false docs: - docker-compose -f docs_website/docker-compose.yml --project-directory=. up + docker-compose -f docs_website/docker-compose.yml --project-directory=. up --build install: make install_pip_runtime_dependencies diff --git a/docs_website/Dockerfile b/docs_website/Dockerfile index 5494abee3..db57ac623 100644 --- a/docs_website/Dockerfile +++ b/docs_website/Dockerfile @@ -6,5 +6,6 @@ COPY docs_website/yarn.lock . RUN yarn install COPY docs_website/ /opt/docs_website COPY docs /opt/docs +RUN yarn run build -ENTRYPOINT yarn start --port ${PORT} +ENTRYPOINT yarn run docusaurus serve --build --port ${PORT} --host 0.0.0.0 From 6387111575d2c8f2e3a6a80097fcea8728b1d7a4 Mon Sep 17 00:00:00 2001 From: cgu Date: Fri, 4 Dec 2020 17:30:33 -0500 Subject: [PATCH 3/3] Remove unncessary comments --- docker-compose.yml | 2 -- docs_website/docker-compose.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 52ff50711..732442848 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,5 @@ version: '2.1' -# volumes: -# node_modules: services: web: image: datahub-dev:latest diff --git a/docs_website/docker-compose.yml b/docs_website/docker-compose.yml index dae6367d3..1701021cf 100644 --- a/docs_website/docker-compose.yml +++ b/docs_website/docker-compose.yml @@ -1,7 +1,5 @@ version: '2.1' -# volumes: -# node_modules: services: docs: build: