Fix docker install (#2925)

* Fix docker install

* Move back twenty-eslint-plugin to eslint-plugin-twenty

* fix: add bundled yarn

* Improve makeifle structure

* Update commands and doc

* Add pg_graphql binaries

* Fix

---------

Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
Charles Bochet
2023-12-11 13:36:24 +01:00
committed by GitHub
parent 44ef218fa5
commit 8d53c63801
48 changed files with 1328 additions and 116 deletions

View File

@ -66,7 +66,7 @@ The default values should work out of the box, except for the postgres URL, whic
Open `./packages/twenty-server/.env` and change to the following:
```bash
PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default?connection_limit=1
PG_DATABASE_URL=postgres://twenty:twenty@postgres:5432/default
```
@ -77,7 +77,7 @@ This installation method will also provision a PostgreSQL container.
```bash
make -C packages/twenty-docker dev-build
make docker-dev-build
```
## Step 4: Migrate & seed
@ -86,12 +86,13 @@ Before running the project, you need to initialize the database by running the m
Start the containers:
```bash
make -C packages/twenty-docker dev-up
make docker-dev-up
```
Setup database, run migrations, and seed:
```bash
make -C packages/twenty-docker dev-server-database-init
make docker-dev-sh
yarn nx database:init twenty-server
```
## Step 5: Start Twenty
@ -99,11 +100,13 @@ make -C packages/twenty-docker dev-server-database-init
Run the project with the following commands from the `root` folder:
```bash
make -C packages/twenty-docker dev-server-start
make docker-dev-sh
yarn nx start:dev twenty-server
```
```bash
make -C packages/twenty-docker dev-front-start
make docker-dev-sh
yarn nx start twenty-front
```
You should now have:
@ -113,18 +116,6 @@ You should now have:
Sign in using a seeded demo account `tim@apple.dev` (password: `Applecar2025`) to start using Twenty.
### Optional
If you don't want to use the `make` command and work directly from the container, you can also ssh directly into the container:
```bash
make -C packages/twenty-docker dev-sh
```
Then run commands through yarn and nx:
```bash
yarn nx run twenty-server:database:init
```
### Troubleshooting

View File

@ -37,7 +37,7 @@ twenty
└───twenty-front // contains the frontend code for the application
└───twenty-server // contains the backend code for the application
└───twenty-docker // contains docker configurations for development and production build
└───many other packages your are invited to discover such as twenty-docs, twenty-ui, twenty-eslint-plugin, twenty-zapier...
└───many other packages your are invited to discover such as twenty-docs, twenty-ui, eslint-plugin-twenty, twenty-zapier...
```
## IDE Setup

View File

@ -118,14 +118,14 @@ You need to provision this database with a `twenty` user (password: `twenty`), a
<br /><br />
```bash
make provision-postgres-linux
make postgres-provision-on-linux
```
<b>Option 2:</b> If you have docker installed:
<br /><br />
```bash
make provision-postgres-docker
make postgres-provision-on-docker
```
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
You can access this using `twenty` postgres user (password: `twenty`)
@ -136,15 +136,15 @@ You can access this using `twenty` postgres user (password: `twenty`)
<br /><br />
```bash
make provision-postgres-macos-intel #for intel architecture
make provision-postgres-macos-arm #for M1/M2/M3 architecture
make postgres-provision-on-macos-intel #for intel architecture
make postgres-provision-on-macos-arm #for M1/M2/M3 architecture
```
<b>Option 2:</b> If you have docker installed:
<br /><br />
```bash
make provision-postgres-docker
make postgres-provision-on-docker
```
This will create a Docker container, exposing a PostgresSQL instance at [http://localhost:5432](http://localhost:5432).
You can access this using `twenty` postgres user (password: `twenty`)
@ -183,9 +183,7 @@ Use `nvm` to install the correct `node` version. The `.nvmrc` ensures all contri
To build Twenty server and seed some data into your database, run the following commands:
```bash
nvm install #recommended
nvm use #recommended
corepack enable #to enable yarn if you haven't done it yet
yarn set version stable #to set the yarn version to yarn version 4
nvm use #recommended
yarn
```
@ -194,14 +192,13 @@ yarn
Setup your database with the following command:
```bash
yarn nx run twenty-server:database:init
yarn nx database:init twenty-server
```
Start the server and the frontend:
```bash
yarn nx run twenty-server:database:init
yarn nx run twenty-server:start:dev
yarn nx run twenty-front:dev
yarn nx start:dev twenty-server
yarn nx start twenty-front
```
Twenty's server will be up and running at [http://localhost:3000/graphql](http://localhost:3000/graphql).