Added info about SERVER_URL to docs (#4433)

* Added info about reverse-proxy and SERVER_URL to docs

* Fixed comments

* Fix lint

---------

Co-authored-by: Maciej Siwek <maciej.siwek@resly.se>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Maciej Siwek 2024-03-14 18:10:59 +01:00 committed by GitHub
parent fbc7e6ab6e
commit 2d48cf5648
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,14 +6,33 @@ sidebar_custom_props:
---
# Step by step instructions:
1) Copy the [.env.example](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/.env.example) into a `.env` in the same directory where your `docker-compose.yml` file will be
2) Run the command `openssl rand -base64 32` three times, make note of the string for each
3) Replace the three "replace_me_with_a_random_string_access" with the three random strings you just generated.
4) Create a `docker-compose.yml` file from the example below.
5) Run the command `docker-compose up -d`
6) Go to http://localhost:3001 and see your docker instance.
1. Copy the [.env.example](https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/.env.example) into a `.env` in the same directory where your `docker-compose.yml` file will be
2. Run the command `openssl rand -base64 32` three times, make note of the string for each
3. In your .env file, replace the three "replace_me_with_a_random_string_access" with the three random strings you just generated.
```
ACCESS_TOKEN_SECRET=replace_me_with_a_random_string_access
LOGIN_TOKEN_SECRET=replace_me_with_a_random_string_login
REFRESH_TOKEN_SECRET=replace_me_with_a_random_string_refresh
```
4. Create a `docker-compose.yml` file from the example below.
5. Run the command `docker-compose up -d`
6. Go to http://localhost:3001 and see your docker instance.
## Troubleshooting
### Not able to login
If you encounter errors, (not able to log into the application after inputting an email) after the inital setup, try running `docker exec -it twenty_backend_1 yarn database:reset` and see if that solves your issue.
### Cannot connect to server, running behind a reverse proxy
Complete step three and four with :
3. Add `SERVER_URL=https://<your-api-url.com>` to your `.env`
4. Uncomment `SERVER_URL=${SERVER_URL}` in your `docker-compose.yml`
- If you encounter errors, (not able to log into the application after inputting an email) after the inital setup, try running `docker exec -it twenty_backend_1 yarn database:reset` and see if that solves your issue.
## Production docker containers
Prebuilt images for both Postgres, frontend, and back-end can be found on [docker hub](https://hub.docker.com/r/twentycrm/).
@ -59,6 +78,8 @@ services:
- ACCESS_TOKEN_SECRET=${ACCESS_TOKEN_SECRET}
- LOGIN_TOKEN_SECRET=${LOGIN_TOKEN_SECRET}
- REFRESH_TOKEN_SECRET=${REFRESH_TOKEN_SECRET}
# Uncomment if behind a reverse proxy
# - SERVER_URL=${SERVER_URL}
depends_on:
- db