From 144a0191de86c32ded55f984d4790aeba9062cfd Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Mon, 13 Feb 2023 22:40:42 +0100 Subject: [PATCH] add docker files --- docker/Dockerfile | 17 +++++++++++++++++ docker/nginx.conf | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/nginx.conf diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..02b0492 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,17 @@ +FROM node:lts-alpine as build-client + +RUN echo "Build WebPlay Client" +RUN apk update +RUN apk add git +RUN git clone https://code.anufrij.de/WebPlay/client.git && cd client +RUN sed -i '/"electron":/d' client/package.json +RUN sed -i '/"electron-builder":/d' client/package.json +RUN sed -i '/"express":/d' client/package.json + +RUN cd client && npm install +RUN cd client && npm run build + +FROM nginx:alpine + +COPY --from=build-client /client/dist /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/conf.d/default.conf diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..45c7b41 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80; + root /usr/share/nginx/html; + client_max_body_size 2G; + location /.well-known { + resolver 127.0.0.11; + proxy_set_header Host $http_host; + proxy_pass http://server:31204/well-known; + } + location /api { + resolver 127.0.0.11; + proxy_set_header Host $http_host; + proxy_pass http://server:31204/api; + } + location /users { + resolver 127.0.0.11; + proxy_set_header Host $http_host; + proxy_pass http://server:31204/users; + } +}