Skip to content

Commit

Permalink
Merge pull request #178 from bento-platform/update-webpack
Browse files Browse the repository at this point in the history
Refactor: use more null coalescing, update terminology, add Dockerfiles, update dependencies
  • Loading branch information
davidlougheed authored Dec 5, 2022
2 parents 5ef924a + 9290033 commit c50f0f4
Show file tree
Hide file tree
Showing 25 changed files with 7,149 additions and 9,722 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github
dist
node_modules
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ module.exports = {
"SharedArrayBuffer": "readonly",
"process": "readonly",
},
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
"jsx": true,
"modules": true,
},
"ecmaVersion": 2019,
"sourceType": "module"
"sourceType": "module",
},
"plugins": [
"react"
Expand Down
1 change: 1 addition & 0 deletions .idea/dictionaries/davidlougheed.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18-bullseye-slim AS build
# Build bento_web with NodeJS + Webpack

WORKDIR /web

COPY package.json package.json
COPY package-lock.json package-lock.json

RUN npm ci

COPY . .

RUN npm run build

FROM nginx:1.23
# Serve bento_web with NGINX

COPY nginx.conf /etc/nginx/nginx.conf

WORKDIR /web
COPY --from=build /web/dist ./dist
10 changes: 10 additions & 0 deletions dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18-bullseye-slim

WORKDIR /web

COPY package.json package.json
COPY package-lock.json package-lock.json

RUN npm ci

ENTRYPOINT [ "sh", "./entrypoint.dev.sh" ]
9 changes: 9 additions & 0 deletions entrypoint.dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ -z "${BENTO_WEB_PORT}" ]; then
# Set default internal port to 80
export BENTO_WEB_PORT=80
fi

npm install
npm run start
21 changes: 21 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
events {
worker_connections 1024;
}

http {
# Includes mapping of file name extensions to MIME types of responses
# and defines the default type.
include /etc/nginx/mime.types;
default_type application/octet-stream;

server {
listen 80;

server_name _;

location / {
root /web/dist;
try_files $uri $uri/ /index.html;
}
}
}
Loading

0 comments on commit c50f0f4

Please sign in to comment.