From d0d01e65ec2c62a46f3a01a7463c32a0de2d97d9 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 31 Oct 2021 20:41:22 +0000 Subject: [PATCH] :whale: Alpha of Dashy-lite Docker container --- docker/Dockerfile-lite | 22 ++++++++++++++++++++++ docker/nginx.conf | 15 +++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docker/Dockerfile-lite create mode 100644 docker/nginx.conf diff --git a/docker/Dockerfile-lite b/docker/Dockerfile-lite new file mode 100644 index 00000000..8280d38c --- /dev/null +++ b/docker/Dockerfile-lite @@ -0,0 +1,22 @@ +# ----------------------------------------------------------------------------------------- +# A light-weight alternative Docker image, using NGINX rather than Node.js to serve the app +# This means that certain features that require server-side endpoints will not be available +# ----------------------------------------------------------------------------------------- + +# Build Stage - Install dependencies + build the app +FROM node:lts-alpine3.14 as build +WORKDIR /dashy +COPY package*.json . +COPY yarn.lock . +RUN yarn +COPY . . +RUN yarn build + +# Production Stage - Serve up built files with NGINX +FROM nginx:alpine as production +COPY ./docker/nginx.conf /etc/nginx/nginx.conf +COPY --from=build /dashy/dist /usr/share/nginx/html +EXPOSE 80 +ENTRYPOINT ["nginx", "-g", "daemon off;"] + +LABEL maintainer="Alicia Sykes " diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 00000000..82f6843b --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,15 @@ +worker_processes 4; + +events { worker_connections 1024; } + +http { + server { + listen 80; + root /usr/share/nginx/html; + include /etc/nginx/mime.types; + + location /appui { + try_files $uri /index.html; + } + } +} \ No newline at end of file