-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(deployment): serve frontend from backend, making proxy redun…
…dant (#319) Co-authored-by: Anatol Karalkoŭ <[email protected]> Return default chart names
- Loading branch information
Showing
632 changed files
with
1,207 additions
and
2,892 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# compiled output | ||
/dist | ||
/public/build | ||
/client/build | ||
/node_modules | ||
|
||
# Logs | ||
|
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,27 +1,92 @@ | ||
FROM node:14 | ||
################### | ||
# BUILD FOR LOCAL DEVELOPMENT | ||
################### | ||
|
||
WORKDIR /var/www/ | ||
FROM node:14-alpine As development | ||
|
||
COPY package*.json ./ | ||
WORKDIR /usr/src/app | ||
|
||
RUN npm ci -q | ||
COPY --chown=node:node package*.json ./ | ||
COPY --chown=node:node tsconfig.build.json ./ | ||
COPY --chown=node:node tsconfig.json ./ | ||
COPY --chown=node:node nest-cli.json ./ | ||
COPY --chown=node:node mikro-orm.config.ts ./ | ||
COPY --chown=node:node .env ./ | ||
COPY --chown=node:node config ./config | ||
COPY --chown=node:node keycloak ./keycloak | ||
COPY --chown=node:node client ./client | ||
COPY --chown=node:node src ./src | ||
|
||
COPY config ./config | ||
COPY tsconfig.build.json ./ | ||
COPY tsconfig.json ./ | ||
COPY nest-cli.json ./ | ||
COPY .env ./ | ||
COPY src ./src | ||
|
||
RUN apk add --no-cache --virtual .gyp python3 py3-pip make g++ | ||
|
||
RUN npm ci | ||
RUN npm ci --prefix=client --only=prod | ||
|
||
RUN apk del .gyp | ||
|
||
USER node | ||
|
||
################### | ||
# BUILD FOR PRODUCTION | ||
################### | ||
|
||
FROM node:14-alpine As build | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY --chown=node:node package*.json ./ | ||
COPY --chown=node:node tsconfig.build.json ./ | ||
COPY --chown=node:node tsconfig.json ./ | ||
COPY --chown=node:node nest-cli.json ./ | ||
COPY --chown=node:node mikro-orm.config.ts ./ | ||
COPY --chown=node:node .env ./ | ||
COPY --chown=node:node config ./config | ||
COPY --chown=node:node keycloak ./keycloak | ||
COPY --chown=node:node client ./client | ||
COPY --chown=node:node src ./src | ||
|
||
COPY --chown=node:node --from=development /usr/src/app/node_modules ./node_modules | ||
COPY --chown=node:node --from=development /usr/src/app/client/node_modules ./client/node_modules | ||
|
||
RUN apk add --no-cache --virtual .gyp python3 py3-pip make g++ | ||
|
||
# Install project dependencies before running build commands | ||
RUN npm ci | ||
|
||
RUN npm run build | ||
RUN npm prune --production | ||
# Build the client (React) project | ||
RUN cd client && npm ci && npm run build | ||
|
||
ENV NODE_ENV production | ||
|
||
RUN npm ci --only=production && npm cache clean --force | ||
|
||
RUN chown -R node:node /var/www/* | ||
RUN apk del .gyp | ||
|
||
USER node | ||
|
||
ENV NODE_ENV=production | ||
################### | ||
# PRODUCTION | ||
################### | ||
|
||
FROM node:14-alpine As production | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY --chown=node:node nest-cli.json ./ | ||
COPY --chown=node:node mikro-orm.config.ts ./ | ||
COPY --chown=node:node .env ./ | ||
COPY --chown=node:node config ./config | ||
COPY --chown=node:node keycloak ./keycloak | ||
|
||
COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules | ||
COPY --chown=node:node --from=build /usr/src/app/package*.json ./ | ||
COPY --chown=node:node --from=build /usr/src/app/dist ./dist | ||
|
||
EXPOSE 3000 | ||
COPY --chown=node:node --from=build /usr/src/app/client/node_modules ./client/node_modules | ||
COPY --chown=node:node --from=build /usr/src/app/client/package*.json ./client/ | ||
COPY --chown=node:node --from=build /usr/src/app/client/build ./client/build | ||
COPY --chown=node:node --from=build /usr/src/app/client/vcs ./client/vcs | ||
|
||
CMD ["npm", "run", "start:prod"] | ||
CMD ["npm", "run", "start:prod"] |
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 |
---|---|---|
|
@@ -3,5 +3,5 @@ ingress: | |
cert: "" | ||
authlevel: "." | ||
images: | ||
main: stable | ||
client: stable | ||
main: experimental | ||
client: unstable |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.