Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.formatOnSave": true,
"editor.tabSize": 2
"editor.tabSize": 2,
"files.insertFinalNewline": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

}
30 changes: 7 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
#######################
# Builder
#######################
FROM node:11.15.0 as builder
FROM node:14.16.0-alpine

WORKDIR /usr/src/app

COPY . .

ENV REACT_APP_API=REACT_APP_API_PLACEHOLDER
ENV REACT_APP_EGO_CLIENT_ID=REACT_APP_EGO_CLIENT_ID_PLACEHOLDER

RUN yarn install && yarn build

#######################
# Server
#######################
FROM nginx:1.17.8-alpine

COPY --from=builder /usr/src/app/build /usr/share/nginx/html
COPY nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
COPY nginx/nginx.conf /etc/nginx/nginx.conf
RUN yarn install

ENV EGO_UI_USER=egoui
ENV EGO_UI_UID=9999
Expand All @@ -30,14 +15,13 @@ ENV PORT=8080

RUN addgroup -S -g $EGO_UI_GID $EGO_UI_USER \
&& adduser -S -u $EGO_UI_UID -G $EGO_UI_USER $EGO_UI_USER \
&& chown -R $EGO_UI_UID:$EGO_UI_GID /etc/nginx/conf.d \
&& chown -R $EGO_UI_UID:$EGO_UI_GID /var/cache \
&& chown -R $EGO_UI_UID:$EGO_UI_GID /var/log/nginx \
&& chown -R $EGO_UI_UID:$EGO_UI_GID /run
&& chown -R $EGO_UI_UID:$EGO_UI_GID /usr/src/app

# default client_id is set to ego
# defaults
ENV REACT_APP_EGO_CLIENT_ID=ego
ENV REACT_APP_API=http://localhost:8081/
ENV PUBLIC_URL="/"

USER $EGO_UI_UID

CMD uri=\$uri envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'
CMD ["yarn", "run", "serve", "-l", "8080"]
22 changes: 0 additions & 22 deletions nginx/default.conf.template

This file was deleted.

32 changes: 0 additions & 32 deletions nginx/nginx.conf

This file was deleted.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@
"recompose": "^0.26.0",
"semantic-ui-css": "2.2.12",
"semantic-ui-react": "^0.81.1",
"serve": "^11.3.2",
"url-join": "^2.0.2",
"vanilla-ripplejs": "^1.0.3"
},
"bin": {
"serve": "./node_modules/.bin/serve"
},
"scripts": {
"start": "react-scripts-ts start",
"serve": "npm run build && NODE_ENV=production serve -s build",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject",
Expand Down
Loading