Build render (#2188)

* Build for arm and amd

* Add scripts

* Add scripts
This commit is contained in:
Charles Bochet
2023-10-22 23:47:43 +02:00
committed by GitHub
parent e67b2d23ae
commit 42af74eb46
15 changed files with 107 additions and 53 deletions

View File

@ -1,18 +0,0 @@
FROM node:18.16.0-alpine as docs
WORKDIR /app/docs
ARG SHOULD_INDEX_DOC
COPY ./docs/package.json .
COPY ./docs/yarn.lock .
RUN yarn install --prod
COPY ./docs .
RUN npm run build
RUN yarn global add serve
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the documentation."
CMD ["serve", "-s", "./build"]

View File

@ -1,29 +1,3 @@
FROM node:18.16.0-alpine as build
ARG REACT_APP_SERVER_BASE_URL
ARG REACT_APP_SERVER_AUTH_URL
ARG REACT_APP_SERVER_FILES_URL
COPY ./packages/ /app/packages
WORKDIR /app/front
COPY ./front .
RUN yarn install
RUN yarn build
COPY ./infra/prod/front/serve.json ./build
FROM node:18.16.0-alpine as front
WORKDIR /app/front
COPY --from=build /app/front/build ./build
COPY ./front/scripts/inject-runtime-env.sh /app/front/scripts/inject-runtime-env.sh
RUN yarn global add serve
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the frontend."
FROM --platform=linux/amd64 twentycrm/twenty-front as front
CMD ["/bin/sh", "-c", "/app/front/scripts/inject-runtime-env.sh && serve build"]

View File

@ -1,6 +0,0 @@
{
"rewrites": [
{ "source": "!static/**", "destination": "/index.html" }
],
"directoryListing": false
}

View File

@ -1,23 +1,3 @@
FROM node:18.16.0-alpine as build
WORKDIR /app/server
COPY ./server/package.json ./
COPY ./server/yarn.lock ./
COPY ./server/patches ./patches
RUN yarn install
COPY ./server .
RUN npx prisma generate
RUN yarn build
FROM node:18.16.0-alpine as server
COPY --from=build /app/server/dist ./dist
WORKDIR /app/server
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the backend, ensuring it deploys faster and runs the same way regardless of the deployment environment."
FROM --platform=linux/amd64 twentycrm/twenty-server as server
CMD ["node", "dist/src/main"]