-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from specklesystems/cristi/fe-be-separation
frontend / backend separation
- Loading branch information
Showing
8 changed files
with
70 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ packages/viewer/dist | |
.nyc_output | ||
coverage/ | ||
.vscode | ||
.idea | ||
test-queries | ||
|
||
**/.DS_Store | ||
|
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,26 @@ | ||
# NOTE: Docker context should be set to git root directory, to include the viewer | ||
|
||
# build stage | ||
FROM node:14.16-buster-slim as build-stage | ||
|
||
WORKDIR /opt/viewer | ||
COPY packages/viewer/package*.json ./ | ||
RUN npm install | ||
COPY packages/viewer . | ||
RUN npm run build | ||
|
||
WORKDIR /opt/frontend | ||
COPY packages/frontend/package*.json ./ | ||
RUN npm install ../viewer | ||
RUN npm ci | ||
COPY packages/frontend . | ||
RUN npm run build | ||
|
||
|
||
# production stage | ||
FROM nginx:stable-alpine as production-stage | ||
COPY --from=build-stage /opt/frontend/dist /usr/share/nginx/html | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY packages/frontend/nginx/nginx.conf /etc/nginx/conf.d | ||
EXPOSE 80 | ||
CMD ["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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
server { | ||
listen 80; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index app.html; | ||
try_files $uri $uri/ /app.html; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
|
||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} |
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,16 @@ | ||
FROM node:14.16.0-buster-slim as node | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
tini \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV NODE_ENV=production | ||
WORKDIR /app | ||
|
||
COPY packages/server/package*.json ./ | ||
RUN npm ci | ||
|
||
COPY packages/server . | ||
|
||
ENTRYPOINT [ "tini", "--" ] | ||
CMD ["node", "bin/www"] |