Improve Docker-Compose Install Experience (#9781)
This PR updates the docker-compose installation documentation and env sample to improve the setup experience. - Updates the URLs for raw files to reference main branch, which is likely where new users will be pulling from initially. This seems to be the most straightforward option; assume that advanced users who want to retrieve it from a particular tag will know to change the URL for their scenario. - Fixes an improperly stated curl command. - Adds a note that the PGPASSWORD_SUPERUSER should be URL-safe. This is required since the value is later concat into a PG_DATABASE_URL as a URL, and expected to be in proper URL format. Touches on #8597. --------- Co-authored-by: Félix Malfait <felix@twenty.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -39,7 +39,7 @@ jobs:
|
|||||||
echo "Generating secrets..."
|
echo "Generating secrets..."
|
||||||
echo "# === Randomly generated secrets ===" >>.env
|
echo "# === Randomly generated secrets ===" >>.env
|
||||||
echo "APP_SECRET=$(openssl rand -base64 32)" >>.env
|
echo "APP_SECRET=$(openssl rand -base64 32)" >>.env
|
||||||
echo "PGPASSWORD_SUPERUSER=$(openssl rand -base64 32)" >>.env
|
echo "PGPASSWORD_SUPERUSER=$(openssl rand -hex 16)" >>.env
|
||||||
|
|
||||||
echo "Docker compose up..."
|
echo "Docker compose up..."
|
||||||
docker compose up -d || {
|
docker compose up -d || {
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
TAG=latest
|
TAG=latest
|
||||||
|
|
||||||
#PGUSER_SUPERUSER=postgres
|
#PG_DATABASE_USER=postgres
|
||||||
#PGPASSWORD_SUPERUSER=replace_me_with_a_strong_password
|
#PG_DATABASE_PASSWORD=replace_me_with_a_strong_password_without_special_characters
|
||||||
#PG_DATABASE_HOST=db
|
#PG_DATABASE_HOST=db
|
||||||
|
#PG_DATABASE_PORT=5432
|
||||||
#REDIS_URL=redis://redis:6379
|
#REDIS_URL=redis://redis:6379
|
||||||
|
|
||||||
SERVER_URL=http://localhost:3000
|
SERVER_URL=http://localhost:3000
|
||||||
|
|||||||
@ -21,7 +21,7 @@ services:
|
|||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default
|
PG_DATABASE_URL: postgres://${PG_DATABASE_USER:-postgres}:${PG_DATABASE_PASSWORD:-postgres}@${PG_DATABASE_HOST:-db}:${PG_DATABASE_PORT:-5432}/default
|
||||||
SERVER_URL: ${SERVER_URL}
|
SERVER_URL: ${SERVER_URL}
|
||||||
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ services:
|
|||||||
image: twentycrm/twenty:${TAG:-latest}
|
image: twentycrm/twenty:${TAG:-latest}
|
||||||
command: ["yarn", "worker:prod"]
|
command: ["yarn", "worker:prod"]
|
||||||
environment:
|
environment:
|
||||||
PG_DATABASE_URL: postgres://${PGUSER_SUPERUSER:-postgres}:${PGPASSWORD_SUPERUSER:-postgres}@${PG_DATABASE_HOST:-db:5432}/default
|
PG_DATABASE_URL: postgres://${PG_DATABASE_USER:-postgres}:${PG_DATABASE_PASSWORD:-postgres}@${PG_DATABASE_HOST:-db}:${PG_DATABASE_PORT:-5432}/default
|
||||||
SERVER_URL: ${SERVER_URL}
|
SERVER_URL: ${SERVER_URL}
|
||||||
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
||||||
DISABLE_DB_MIGRATIONS: "true" # it already runs on the server
|
DISABLE_DB_MIGRATIONS: "true" # it already runs on the server
|
||||||
@ -70,12 +70,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- db-data:/home/postgres/pgdata
|
- db-data:/home/postgres/pgdata
|
||||||
environment:
|
environment:
|
||||||
PGUSER_SUPERUSER: ${PGUSER_SUPERUSER:-postgres}
|
PGUSER_SUPERUSER: ${PG_DATABASE_USER:-postgres}
|
||||||
PGPASSWORD_SUPERUSER: ${PGPASSWORD_SUPERUSER:-postgres}
|
PGPASSWORD_SUPERUSER: ${PG_DATABASE_PASSWORD:-postgres}
|
||||||
ALLOW_NOSSL: "true"
|
ALLOW_NOSSL: "true"
|
||||||
SPILO_PROVIDER: "local"
|
SPILO_PROVIDER: "local"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: pg_isready -U ${PGUSER_SUPERUSER:-postgres} -h localhost -d postgres
|
test: pg_isready -U ${PG_DATABASE_USER:-postgres} -h localhost -d postgres
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|||||||
@ -90,12 +90,11 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Generate random strings for secrets
|
# Generate random strings for secrets
|
||||||
echo "# === Randomly generated secret ===" >>.env
|
echo "# === Randomly generated secret ===" >> .env
|
||||||
echo "APP_SECRET=$(openssl rand -base64 32)" >>.env
|
echo "APP_SECRET=$(openssl rand -base64 32)" >> .env
|
||||||
|
|
||||||
# Issue with Postgres spilo?
|
echo "" >> .env
|
||||||
#echo "" >>.env
|
echo "PG_DATABASE_PASSWORD=$(openssl rand -hex 16)" >> .env
|
||||||
#echo "PGPASSWORD_SUPERUSER=$(openssl rand -hex 16)" >>.env
|
|
||||||
|
|
||||||
echo -e "\t• .env configuration completed"
|
echo -e "\t• .env configuration completed"
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ Follow these steps for a manual setup.
|
|||||||
|
|
||||||
Copy the example environment file to a new .env file in your working directory:
|
Copy the example environment file to a new .env file in your working directory:
|
||||||
```bash
|
```bash
|
||||||
curl -o .env https://raw.githubusercontent.com/twentyhq/twenty/refs/tags/v0.35.0/packages/twenty-docker/.env.example
|
curl -o .env https://raw.githubusercontent.com/twentyhq/twenty/refs/heads/main/packages/twenty-docker/.env.example
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Generate Secret Tokens**
|
2. **Generate Secret Tokens**
|
||||||
@ -65,7 +65,7 @@ Follow these steps for a manual setup.
|
|||||||
|
|
||||||
4. **Set the Postgres Password**
|
4. **Set the Postgres Password**
|
||||||
|
|
||||||
Update the `PGPASSWORD_SUPERUSER` value in the .env file with a strong password.
|
Update the `PGPASSWORD_SUPERUSER` value in the .env file with a strong password without special characters.
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
PGPASSWORD_SUPERUSER=my_strong_password
|
PGPASSWORD_SUPERUSER=my_strong_password
|
||||||
@ -76,7 +76,7 @@ Follow these steps for a manual setup.
|
|||||||
Download the `docker-compose.yml` file to your working directory:
|
Download the `docker-compose.yml` file to your working directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -O https://raw.githubusercontent.com/twentyhq/twenty/refs/tags/v0.35.0/packages/twenty-docker/docker-compose.yml
|
curl -o docker-compose.yml https://raw.githubusercontent.com/twentyhq/twenty/refs/heads/main/packages/twenty-docker/docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3: Launch the Application
|
### Step 3: Launch the Application
|
||||||
|
|||||||
Reference in New Issue
Block a user