-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ui, api): update config for deployment (#510)
* dump * dump * feat(ui, api): update config * add simple workflow * remove redundant file * remove redundant file * rename flow config to reearth config * ui: lint and better error on start.sh * remove redundant binary
- Loading branch information
Showing
15 changed files
with
107 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# API | ||
FLOW_API=http://localhost:8081 | ||
FLOW_API=http://localhost:8080 | ||
|
||
# Auth0 | ||
FLOW_AUTH0_CLIENT_ID=samople_ID | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM node:lts as build | ||
|
||
COPY package.json yarn.lock ./ | ||
|
||
RUN yarn install | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN corepack enable | ||
RUN corepack prepare yarn@4.3.1 --activate | ||
|
||
RUN yarn install | ||
|
||
RUN yarn build | ||
|
||
FROM nginx:stable | ||
|
||
COPY --from=build app/dist /usr/share/nginx/html | ||
|
||
COPY reearth_config.template.json /usr/share/nginx/html/ | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
|
||
COPY nginx.conf /etc/nginx/conf.d | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
RUN apt-get update && apt-get install -y gettext-base && rm -rf /var/lib/apt/lists/* | ||
|
||
COPY start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
|
||
COPY --from=build ./dist /usr/share/nginx/html | ||
EXPOSE 3000 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
version: "3" | ||
services: | ||
reearth-flow-ui: | ||
image: reearth/reearth-flow-ui:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "80:80" | ||
- "3000:3000" | ||
volumes: | ||
- ./dist:/usr/share/nginx/html | ||
- ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
- ./ui:/app | ||
- /app/node_modules | ||
environment: | ||
- NODE_ENV=development | ||
command: ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"api": "${FLOW_API}", | ||
"auth0Audience": "${FLOW_AUTH0_AUDIENCE}", | ||
"auth0ClientId": "${FLOW_AUTH0_CLIENT_ID}", | ||
"auth0Domain": "${FLOW_AUTH0_DOMAIN}", | ||
"brandName": "${FLOW_BRAND_NAME}", | ||
"devMode": "${FLOW_DEV_MODE}", | ||
"documentationUrl": "${FLOW_DOCUMENTATION_URL}", | ||
"tosUrl": "${FLOW_TOS_URL}", | ||
"version": "${FLOW_VERSION}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
# Signal handling | ||
trap 'echo "Shutting down..."; nginx -s quit; exit 0' SIGTERM SIGINT | ||
|
||
# Generate the reearth_config.json from the template | ||
envsubst < /usr/share/nginx/html/reearth_config.template.json > /usr/share/nginx/html/reearth_config.json | ||
if [ $? -ne 0 ]; then | ||
echo "Error generating flow_config.json" | ||
exit 1 | ||
fi | ||
|
||
# Start nginx | ||
nginx -g 'daemon off;' & | ||
|
||
# Wait for any process to exit | ||
wait -n | ||
|
||
# Exit with status of process that exited first | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters