From afab5940b3f4d2f0d9233dbb989de6caeec906f6 Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Thu, 13 Apr 2023 12:40:44 +0200 Subject: [PATCH] Create Dockerfile for front production --- README.md | 15 --------------- infra/prod/front/Dockerfile | 11 +++++++++++ infra/prod/twenty/Dockerfile | 16 ---------------- 3 files changed, 11 insertions(+), 31 deletions(-) create mode 100644 infra/prod/front/Dockerfile delete mode 100644 infra/prod/twenty/Dockerfile diff --git a/README.md b/README.md index bf3007c307..77ca507a5e 100644 --- a/README.md +++ b/README.md @@ -13,21 +13,6 @@ Twenty development stack is composed of 3 different layers 1. `cp ./infra/dev/.front.env.example ./front/.env` and fill with values -## Development environment setup with npm (Not recommended) - -This is the easiest way to get started contributing to twenty -Make sure you have `node@18` installed on your machine. You can use `nvm` to manage your nvm versions in case you have projects that require different node versions. - -`npm run install-dev` -`npm run front` - -You'll need to provide your own postgres storage. - -Once this is completed you should have: -- front available on: http://localhost:3001 -- server available on: http://localhost:3000/health - - ## Development environment setup with docker-compose (Recommended) We also provide a containerized environment with Docker and orchestrated with docker-compose in case it is easier for you. This install will also provision a postgres container out of the box. diff --git a/infra/prod/front/Dockerfile b/infra/prod/front/Dockerfile new file mode 100644 index 0000000000..ade457c0ca --- /dev/null +++ b/infra/prod/front/Dockerfile @@ -0,0 +1,11 @@ +FROM node:18-alpine as front + +WORKDIR /app/front +COPY ./front . + +RUN npm install --production +RUN npm run build + +RUN npm install -g serve + +CMD ["serve", "-s", "build"] diff --git a/infra/prod/twenty/Dockerfile b/infra/prod/twenty/Dockerfile deleted file mode 100644 index 44087ec3cf..0000000000 --- a/infra/prod/twenty/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM node:18-alpine as app - -ARG REACT_APP_API_URL - -WORKDIR /app -COPY . . - -WORKDIR /app/front -RUN npm install -RUN npm run build - -WORKDIR /app/server -RUN npm install -RUN npm run build - -CMD ["npm", "run", "start:prod"]