feat: add a docker-compose file for production (#4609)

* feat: add a docker-compose file for production

* fix: remove unused user filed

* fix: do not provide default token secrets
This commit is contained in:
Quentin G
2024-03-22 09:16:39 +01:00
committed by GitHub
parent 1aa48d3bf7
commit aee6d49ea9
2 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
TAG=latest
POSTGRES_ADMIN_PASSWORD=replace_me_with_a_strong_password
PG_DATABASE_HOST=db:5432
SERVER_URL=http://localhost:3000
# Uncoment if you are serving your front on another server than the API (eg. bucket)
# FRONT_BASE_URL=http://localhost:3000
# Use openssl rand -base64 32 for each secret
# 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
SIGN_IN_PREFILLED=true

View File

@@ -0,0 +1,52 @@
version: '3.8'
name: twenty
services:
server:
image: twentycrm/twenty:${TAG}
volumes:
- server-local-data:/app/.local-storage
ports:
- "3000:3000"
environment:
PORT: 3000
PG_DATABASE_URL: postgres://twenty:twenty@${PG_DATABASE_HOST}/default
SERVER_URL: ${SERVER_URL}
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
ENABLE_DB_MIGRATIONS: true
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
STORAGE_TYPE: local
STORAGE_LOCAL_PATH: .local-storage
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
LOGIN_TOKEN_SECRET: ${LOGIN_TOKEN_SECRET}
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail http://localhost:3000/healthz | jq -e '.status == \"ok\"' > /dev/null || exit 1"]
interval: 5s
timeout: 5s
retries: 10
restart: always
db:
image: twentycrm/twenty-postgres:${TAG}
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
#POSTGRES_USER: ${POSTGRES_USER}
#POSTGRES_DB: ${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U twenty -d default"]
interval: 5s
timeout: 5s
retries: 10
restart: always
volumes:
db-data:
server-local-data: