From 15855c140d21073f9c3d0929bf3345d1893157ce Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 4 Dec 2020 16:47:17 +0000 Subject: [PATCH 01/29] WBSTACK MODIFICATIONS Initial modifications --- .dockerignore | 4 + Dockerfile | 18 ++++ docker-compose.yaml | 10 ++ docker/default.conf | 35 ++++++ index.html | 9 ++ style.less | 183 +++++++++++++++++++++++++++++++- wikibase/config.js | 58 +++++++++- wikibase/init.js | 8 +- wikibase/queryService/ui/App.js | 4 +- 9 files changed, 323 insertions(+), 6 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yaml create mode 100644 docker/default.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..471d35d8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +# We only want to ignore these for the docker build +# I hope they are included in docker-compose... +/src/node_modules +/src/build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..82c73277 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:12 as builder + +WORKDIR /src/app + +COPY package.json package-lock.json ./ + +# TODO remove the --force from the install... +RUN npm install --force && npm cache clean --force + +COPY . . + +RUN npm run-script build + + +FROM nginx:1-alpine + +ADD ./nginx/default.conf /etc/nginx/conf.d/default.conf +COPY --from=builder --chown=nginx:nginx /src/app/build /usr/share/nginx/html diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..c50cdb17 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,10 @@ +version: "3.7" +services: + debug: + image: node:12-alpine + working_dir: /home/node/app + command: npm start + volumes: + - ./src:/home/node/app + expose: + - "8080" diff --git a/docker/default.conf b/docker/default.conf new file mode 100644 index 00000000..15a58229 --- /dev/null +++ b/docker/default.conf @@ -0,0 +1,35 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + server_name localhost; + charset utf-8; + + # files transfer + client_body_in_file_only clean; + client_body_buffer_size 32K; + client_max_body_size 1026g; + sendfile on; + send_timeout 300s; + + # redirect server error pages / and set response status to 200 / ok + #error_page 404 =200 /; + + root /usr/share/nginx/html; + index index.html index.html; + + # Always serve index.html for any request +# location / { +# root /usr/share/nginx/html; +# try_files $uri /index.html; +# } + + # deny access to .htaccess files, if Apache's document root concurs with nginx's one + location ~ /\.ht { + deny all; + } + + # deny access to hidden files (beginning with a period) + location ~ /\. { + access_log off; log_not_found off; deny all; + } +} diff --git a/index.html b/index.html index e84e7c48..787e3d1b 100644 --- a/index.html +++ b/index.html @@ -429,6 +429,14 @@