Skip to content

Commit

Permalink
🐳 Alpha of Dashy-lite Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Oct 31, 2021
1 parent f489a92 commit d0d01e6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docker/Dockerfile-lite
Original file line number Diff line number Diff line change
@@ -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 <alicia@omg.lol>"
15 changes: 15 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
}

0 comments on commit d0d01e6

Please sign in to comment.