feat: add one liner install command (#4613)
* feat: add one liner * fix: interactive issue & add support for both linux & mac * feat: move quick start documentation * feat: catch errors * feat: check if directory exists * feat: default to yes for prompt * feat: open in browser * fix: format * feat: do not expose STORAGE_LOCAL_PATH env but handle the case where it would be set * fix: db reset command wasn't working out of the box * Update install.sh Co-authored-by: Darek Desu <4459421+darekdesu@users.noreply.github.com> * feat: harden the whole UX with one-liner * fix: small logical order adjustment * Update packages/twenty-docs/docs/start/self-hosting/docker-compose.mdx --------- Co-authored-by: Darek Desu <4459421+darekdesu@users.noreply.github.com> Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -15,3 +15,9 @@ SERVER_URL=http://localhost:3000
|
||||
# FILE_TOKEN_SECRET=replace_me_with_a_random_string_refresh
|
||||
|
||||
SIGN_IN_PREFILLED=true
|
||||
|
||||
STORAGE_TYPE=local
|
||||
|
||||
# STORAGE_S3_REGION=eu-west3
|
||||
# STORAGE_S3_NAME=my-bucket
|
||||
# STORAGE_S3_ENDPOINT=
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
version: '3.8'
|
||||
name: twenty
|
||||
|
||||
services:
|
||||
server:
|
||||
image: twentycrm/twenty:${TAG}
|
||||
volumes:
|
||||
- server-local-data:/app/.local-storage
|
||||
- server-local-data:/app/${STORAGE_LOCAL_PATH:-.local-storage}
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
@ -17,8 +16,10 @@ services:
|
||||
ENABLE_DB_MIGRATIONS: true
|
||||
|
||||
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
|
||||
STORAGE_TYPE: local
|
||||
STORAGE_LOCAL_PATH: .local-storage
|
||||
STORAGE_TYPE: ${STORAGE_TYPE}
|
||||
STORAGE_S3_REGION: ${STORAGE_S3_REGION}
|
||||
STORAGE_S3_NAME: ${STORAGE_S3_NAME}
|
||||
STORAGE_S3_ENDPOINT: ${STORAGE_S3_ENDPOINT}
|
||||
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
|
||||
LOGIN_TOKEN_SECRET: ${LOGIN_TOKEN_SECRET}
|
||||
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
|
||||
@ -27,7 +28,7 @@ services:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl --silent --fail http://localhost:3000/healthz | jq -e '.status == \"ok\"' > /dev/null || exit 1"]
|
||||
test: curl --fail http://localhost:3000/healthz
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
@ -39,10 +40,8 @@ services:
|
||||
- db-data:/bitnami/postgresql
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
|
||||
#POSTGRES_USER: ${POSTGRES_USER}
|
||||
#POSTGRES_DB: ${POSTGRES_DB}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U twenty -d default"]
|
||||
test: pg_isready -U twenty -d default
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check if the initialization has already been done and that we enabled automatic migration
|
||||
if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/${STORAGE_LOCAL_PATH}/db_initialized ]; then
|
||||
if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/${STORAGE_LOCAL_PATH:-.local-storage}/db_initialized ]; then
|
||||
echo "Running database setup and migrations..."
|
||||
|
||||
# Run setup and migration scripts
|
||||
@ -10,7 +10,7 @@ if [ "${ENABLE_DB_MIGRATIONS}" = "true" ] && [ ! -f /app/${STORAGE_LOCAL_PATH}/d
|
||||
|
||||
# Mark initialization as done
|
||||
echo "Successfuly migrated DB!"
|
||||
touch /app/${STORAGE_LOCAL_PATH}/db_initialized
|
||||
touch /app/${STORAGE_LOCAL_PATH:-.local-storage}/db_initialized
|
||||
fi
|
||||
|
||||
# Continue with the original Docker command
|
||||
|
||||
Reference in New Issue
Block a user