From a7a4052109a8f7c63c034328923994a7d93dac2f Mon Sep 17 00:00:00 2001 From: BOHEUS <56270748+BOHEUS@users.noreply.github.com> Date: Sun, 13 Oct 2024 20:40:27 +0200 Subject: [PATCH] Docker cleanup (#7655) Related to #7648 @charlesBochet I've deleted only dev related commands in Makefile, if it's wrong, I'll change it ASAP --- packages/twenty-docker/Makefile | 25 --------------- .../twenty-docker/twenty-website/Dockerfile | 29 ----------------- .../src/content/developers/local-setup.mdx | 31 +++++++++++++------ .../self-hosting/docker-compose.mdx | 4 +++ 4 files changed, 26 insertions(+), 63 deletions(-) delete mode 100644 packages/twenty-docker/twenty-website/Dockerfile diff --git a/packages/twenty-docker/Makefile b/packages/twenty-docker/Makefile index deee953f19..e8d77b60bf 100644 --- a/packages/twenty-docker/Makefile +++ b/packages/twenty-docker/Makefile @@ -1,28 +1,3 @@ -dev-build: - @docker compose -f dev/docker-compose.yml down -v - @docker compose -f dev/docker-compose.yml build - -dev-up: - @docker compose -f dev/docker-compose.yml up -d - -dev-start: - @docker compose -f dev/docker-compose.yml start - -dev-stop: - @docker compose -f dev/docker-compose.yml stop - -dev-down: - @docker compose -f dev/docker-compose.yml down -v - -dev-sh: - @docker compose -f dev/docker-compose.yml exec twenty-dev sh - -dev-postgres-build: - @docker stop twenty_postgres || true - @docker rm twenty_postgres || true - @docker volume rm twenty_db_data || true - @docker compose -f dev/docker-compose.yml up --build postgres -d - prod-build: @cd ../.. && docker build -f ./packages/twenty-docker/twenty/Dockerfile --tag twenty . && cd - diff --git a/packages/twenty-docker/twenty-website/Dockerfile b/packages/twenty-docker/twenty-website/Dockerfile deleted file mode 100644 index e3b7420ff7..0000000000 --- a/packages/twenty-docker/twenty-website/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM node:18.17.1-alpine as twenty-website-build - - -WORKDIR /app - -COPY ./package.json . -COPY ./yarn.lock . -COPY ./.yarnrc.yml . -COPY ./.yarn/releases /app/.yarn/releases -COPY ./tools/eslint-rules /app/tools/eslint-rules -COPY ./packages/twenty-website/package.json /app/packages/twenty-website/package.json - -RUN yarn - -COPY ./packages/twenty-website /app/packages/twenty-website -RUN npx nx build twenty-website - -FROM node:18.17.1-alpine as twenty-website - -WORKDIR /app/packages/twenty-website - -COPY --from=twenty-website-build /app /app - -WORKDIR /app/packages/twenty-website - -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 website." - -CMD ["/bin/sh", "-c", "npx nx start"] \ No newline at end of file diff --git a/packages/twenty-website/src/content/developers/local-setup.mdx b/packages/twenty-website/src/content/developers/local-setup.mdx index 5bd90da66a..6bae7137c2 100644 --- a/packages/twenty-website/src/content/developers/local-setup.mdx +++ b/packages/twenty-website/src/content/developers/local-setup.mdx @@ -124,7 +124,7 @@ You can access the database at [localhost:5432](localhost:5432), with user `twen All the following steps are to be run in the WSL terminal (within your virtual machine) - Option 1 : To provision your database locally: + Option 1: To provision your database locally: ```bash make postgres-on-linux ``` @@ -145,16 +145,33 @@ Twenty requires a redis cache to provide the best performances + Option 1: To provision your Redis locally: Use the following link to install Redis on your Linux machine: [Redis Installation](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-linux/) - - - To provision your database locally with `brew`: + + Option 2: If you have docker installed: ```bash - brew install redis + docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest ``` + Option 1:To provision your Redis locally with `brew`: + ```bash + brew install redis + ``` + + Option 2: If you have docker installed: + ```bash + docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest + ``` + + + Option 1: To provision your Redis locally: Use the following link to install Redis on your Linux virtual machine: [Redis Installation](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-linux/) + + Option 2: If you have docker installed: + ```bash + docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest + ``` @@ -262,8 +279,4 @@ This should work out of the box with the eslint extension installed. If this doe } ``` -#### Docker container build - -To successfully build Docker images, ensure that your system has a minimum of 2GB of memory available. For users of Docker Desktop, please verify that you've allocated sufficient resources to Docker within the application's settings. - diff --git a/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx b/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx index 833fffbcc4..14aa5821c9 100644 --- a/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx +++ b/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx @@ -4,6 +4,10 @@ icon: TbBrandDocker image: /images/user-guide/objects/objects.png --- + +Docker containers are for production hosting or self-hosting, for the contribution please check the [Local Setup](https://twenty.com/developers/local-setup). + + ## Overview This guide provides step-by-step instructions to install and configure the Twenty application using Docker Compose. The aim is to make the process straightforward and prevent common pitfalls that could break your setup.