forked from aesirxio/bi-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
180 additions
and
2,957 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,4 +1,4 @@ | ||
**/node_modules | ||
**/npm-debug.log | ||
build | ||
dist | ||
**/build | ||
**/dist |
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,46 +1,43 @@ | ||
|
||
## Deps | ||
FROM node:16-alpine AS deps | ||
## builder | ||
FROM node:16-alpine AS builder | ||
WORKDIR /app | ||
|
||
COPY .git . | ||
COPY nx.json . | ||
COPY package.json . | ||
COPY yarn.lock . | ||
|
||
RUN yarn install --frozen-lockfile --network-timeout 600000 | ||
|
||
## Builder | ||
FROM node:16-alpine AS builder | ||
WORKDIR /app | ||
|
||
# Cache and Install dependencies | ||
COPY --from=deps ./app/node_modules ./node_modules | ||
COPY packages packages | ||
|
||
# Copy app files | ||
COPY ./.git ./ | ||
COPY ./package.json ./ | ||
COPY ./jsconfig.json ./ | ||
COPY ./.eslintrc ./ | ||
COPY ./babel.config.json ./ | ||
COPY ./craco.config.js ./ | ||
COPY ./public ./public/ | ||
COPY ./src ./src/ | ||
RUN apk add --update --no-cache \ | ||
make \ | ||
g++ \ | ||
jpeg-dev \ | ||
cairo-dev \ | ||
giflib-dev \ | ||
pango-dev \ | ||
libtool \ | ||
autoconf \ | ||
automake \ | ||
git | ||
|
||
ENV GENERATE_SOURCEMAP=false | ||
RUN apk add --no-cache git | ||
RUN yarn install --frozen-lockfile --network-timeout 600000 | ||
|
||
# Build the app | ||
RUN npx craco build | ||
RUN yarn build | ||
|
||
# Bundle static assets | ||
FROM node:16-alpine AS production | ||
WORKDIR /app | ||
|
||
# Copy built assets from builder | ||
COPY --from=builder ./app/build ./build | ||
COPY --from=builder app/packages/aesirx-bi-app/build build | ||
|
||
RUN yarn add serve react-inject-env | ||
|
||
# Expose port | ||
EXPOSE 3000 | ||
|
||
ENTRYPOINT npx react-inject-env set && npx serve -s build | ||
|
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
Oops, something went wrong.