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
This commit is contained in:
BOHEUS 2024-10-13 20:40:27 +02:00 committed by GitHub
parent ee093edc77
commit a7a4052109
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 26 additions and 63 deletions

View File

@ -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 -

View File

@ -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"]

View File

@ -124,7 +124,7 @@ You can access the database at [localhost:5432](localhost:5432), with user `twen
<ArticleTab>
All the following steps are to be run in the WSL terminal (within your virtual machine)
<b>Option 1 :</b> To provision your database locally:
<b>Option 1:</b> To provision your database locally:
```bash
make postgres-on-linux
```
@ -145,16 +145,33 @@ Twenty requires a redis cache to provide the best performances
<ArticleTabs label1="Linux" label2="Mac OS" label3="Windows (WSL)">
<ArticleTab>
<b>Option 1:</b> 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/)
</ArticleTab>
<ArticleTab>
To provision your database locally with `brew`:
<b>Option 2:</b> If you have docker installed:
```bash
brew install redis
docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest
```
</ArticleTab>
<ArticleTab>
<b>Option 1:</b>To provision your Redis locally with `brew`:
```bash
brew install redis
```
<b>Option 2:</b> If you have docker installed:
```bash
docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest
```
</ArticleTab>
<ArticleTab>
<b>Option 1:</b> 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/)
<b>Option 2:</b> If you have docker installed:
```bash
docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest
```
</ArticleTab>
</ArticleTabs>
@ -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.
<ArticleEditContent></ArticleEditContent>

View File

@ -4,6 +4,10 @@ icon: TbBrandDocker
image: /images/user-guide/objects/objects.png
---
<ArticleWarning>
Docker containers are for production hosting or self-hosting, for the contribution please check the [Local Setup](https://twenty.com/developers/local-setup).
</ArticleWarning>
## 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.