Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 17 additions & 57 deletions deploy.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
# =============================================================================
# This file is a template for docker compose deployment
# Copy this file to .env and change the values as needed


# Fully qualified domain name for the deployment. Replace localhost with your domain,
# such as mydomain.com.
FQDN=localhost

# Change this to https if you wish to enable TLS.
SCHEME=http

APPFLOWY_BASE_URL=${SCHEME}://${FQDN}
APPFLOWY_BASE_URL=http://localhost

# =============================================================================
# 🗄️ DATABASE & CACHE: Core data infrastructure
Expand All @@ -24,13 +15,23 @@ POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432
POSTGRES_DB=postgres
POSTGRES_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}

# Redis Settings
REDIS_HOST=redis
REDIS_PORT=6379

# =============================================================================
# 🏗️ INFRASTRUCTURE SERVICES: Object storage and networking
# 📤️ EMAIL configuration
# =============================================================================
SMTP_HOST=your-smtp-host.com
SMTP_USER=user@domain.com
SMTP_PASSWORD=password
SMTP_PORT=587
SMTP_MAIL_FROM=appflowy@domain.com

# =============================================================================
# 🏗️ INFRASTRUCTURE SERVICES: Object storage
# =============================================================================

# MinIO Configuration: S3-compatible object storage for file uploads and attachments
Expand Down Expand Up @@ -59,7 +60,7 @@ APPFLOWY_GOTRUE_BASE_URL=http://gotrue:9999
# URL that connects to the postgres docker container. If your password contains special characters,
# instead of using ${POSTGRES_PASSWORD}, you will need to convert them into url encoded format.
# For example, `p@ssword` will become `p%40ssword`.
APPFLOWY_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
APPFLOWY_DATABASE_URL=${POSTGRES_URL}

# AppFlowy Service Configuration
# Access Control System: Enables/disables permission-based access control
Expand All @@ -82,10 +83,7 @@ APPFLOWY_DATABASE_MAX_CONNECTIONS=40
# URL that connects to the redis docker container
APPFLOWY_REDIS_URI=redis://${REDIS_HOST}:${REDIS_PORT}

# GoTrue database connection. If your password contains special characters,
# instead of using ${POSTGRES_PASSWORD}, use the url encoded version.
# For example, `p@ssword` will become `p%40ssword`
GOTRUE_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?search_path=auth
GOTRUE_DATABASE_URL=${POSTGRES_URL}?search_path=auth

# =============================================================================
# 🔐 GOTRUE: Authentication service configuration
Expand Down Expand Up @@ -117,9 +115,6 @@ GOTRUE_MAILER_AUTOCONFIRM=true
# Set this to true if users can only join by invite
GOTRUE_DISABLE_SIGNUP=false

# Number of emails that can be sent per minute
GOTRUE_RATE_LIMIT_EMAIL_SENT=100

# Email Templates
# Optional. You can provide a public http link (eg. github) to customize your magic link template.
# Refer to https://github.com/supabase/auth?tab=readme-ov-file#configuration for details on how to create a custom email template.
Expand All @@ -143,29 +138,6 @@ ADMIN_FRONTEND_APPFLOWY_CLOUD_URL=http://appflowy_cloud:8000
# or set it to empty string.
ADMIN_FRONTEND_PATH_PREFIX=/console

# =============================================================================
# 📧 EMAIL CONFIGURATION: SMTP settings (optional but recommended for production)
# =============================================================================

# If you intend to use mail confirmation, you need to set the SMTP configuration below
# You would then need to set GOTRUE_MAILER_AUTOCONFIRM=false
# Check for logs in gotrue service if there are any issues with email confirmation
# Note that smtps will be used for port 465, otherwise plain smtp with optional STARTTLS
GOTRUE_SMTP_HOST=smtp.gmail.com
GOTRUE_SMTP_PORT=465
GOTRUE_SMTP_USER=email_sender@some_company.com
GOTRUE_SMTP_PASS=email_sender_password
GOTRUE_SMTP_ADMIN_EMAIL=comp_admin@some_company.com

# AppFlowy Cloud Mailer
# Note that smtps (TLS) is always required, even for ports other than 465
APPFLOWY_MAILER_SMTP_HOST=smtp.gmail.com
APPFLOWY_MAILER_SMTP_PORT=465
APPFLOWY_MAILER_SMTP_USERNAME=email_sender@some_company.com
APPFLOWY_MAILER_SMTP_EMAIL=email_sender@some_company.com
APPFLOWY_MAILER_SMTP_PASSWORD=email_sender_password
APPFLOWY_MAILER_SMTP_TLS_KIND=wrapper # "none" "wrapper" "required" "opportunistic"

# =============================================================================
# 🔑 OAUTH PROVIDERS: Third-party authentication (optional)
# =============================================================================
Expand Down Expand Up @@ -283,7 +255,7 @@ APPFLOWY_EMBEDDING_CHUNK_OVERLAP=200

# AppFlowy Indexer (for search functionality)
APPFLOWY_INDEXER_ENABLED=true
APPFLOWY_INDEXER_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
APPFLOWY_INDEXER_DATABASE_URL=${POSTGRES_URL}
APPFLOWY_INDEXER_REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
APPFLOWY_INDEXER_EMBEDDING_BUFFER_SIZE=5000

Expand All @@ -299,7 +271,7 @@ APPFLOWY_COLLABORATE_REMOVE_BATCH_SIZE=100

# AppFlowy Worker Service
APPFLOWY_WORKER_REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
APPFLOWY_WORKER_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
APPFLOWY_WORKER_DATABASE_URL=${POSTGRES_URL}
APPFLOWY_WORKER_DATABASE_NAME=${POSTGRES_DB}

# =============================================================================
Expand All @@ -308,21 +280,9 @@ APPFLOWY_WORKER_DATABASE_NAME=${POSTGRES_DB}

# AppFlowy Web
# If your AppFlowy Web is hosted on a different domain, update this variable to the correct domain
# If you are running AppFlowy Web locally for development purpose, use http://localhost:3000
APPFLOWY_WEB_URL=${APPFLOWY_BASE_URL}

# If you are running AppFlowy Web locally for development purpose, use the following value instead
# APPFLOWY_WEB_URL=http://localhost:3000

# =============================================================================
# 🗄️ PGADMIN: Database Management Web Interface
# =============================================================================

# PgAdmin credentials for database management web UI
# You can access pgadmin at http://your-host/pgadmin
# Use the APPFLOWY_DATABASE_URL values when connecting to the database
PGADMIN_DEFAULT_EMAIL=admin@example.com
PGADMIN_DEFAULT_PASSWORD=password

# =============================================================================
# 🌐 NGINX: Reverse proxy and web server configuration
# =============================================================================
Expand Down
46 changes: 20 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
services:
nginx:
restart: on-failure
image: nginx
image: appflowyinc/nginx
build: docker/nginx
ports:
- ${NGINX_PORT:-80}:80 # Disable this if you are using TLS
- ${NGINX_PORT:-80}:80
- ${NGINX_TLS_PORT:-443}:443
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl/certificate.crt:/etc/nginx/ssl/certificate.crt
- ./nginx/ssl/private_key.key:/etc/nginx/ssl/private_key.key

# You do not need this if you have configured to use your own s3 file storage
minio:
Expand All @@ -28,10 +25,9 @@ services:
restart: on-failure
image: pgvector/pgvector:pg16
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
- POSTGRES_HOST=${POSTGRES_HOST:-postgres}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}" ]
interval: 5s
Expand Down Expand Up @@ -78,10 +74,10 @@ services:
- API_EXTERNAL_URL=${API_EXTERNAL_URL}
- DATABASE_URL=${GOTRUE_DATABASE_URL}
- PORT=9999
- GOTRUE_SMTP_HOST=${GOTRUE_SMTP_HOST} # e.g. smtp.gmail.com
- GOTRUE_SMTP_PORT=${GOTRUE_SMTP_PORT} # e.g. 465
- GOTRUE_SMTP_USER=${GOTRUE_SMTP_USER} # email sender, e.g. noreply@appflowy.io
- GOTRUE_SMTP_PASS=${GOTRUE_SMTP_PASS} # email password
- GOTRUE_SMTP_HOST=${SMTP_HOST}
- GOTRUE_SMTP_PORT=${SMTP_PORT}
- GOTRUE_SMTP_USER=${SMTP_USER}
- GOTRUE_SMTP_PASS=${SMTP_PASSWORD}
- GOTRUE_MAILER_URLPATHS_CONFIRMATION=/gotrue/verify
- GOTRUE_MAILER_URLPATHS_INVITE=/gotrue/verify
- GOTRUE_MAILER_URLPATHS_RECOVERY=/gotrue/verify
Expand Down Expand Up @@ -128,12 +124,11 @@ services:
- APPFLOWY_S3_BUCKET=${APPFLOWY_S3_BUCKET}
- APPFLOWY_S3_REGION=${APPFLOWY_S3_REGION}
- APPFLOWY_S3_PRESIGNED_URL_ENDPOINT=${APPFLOWY_S3_PRESIGNED_URL_ENDPOINT}
- APPFLOWY_MAILER_SMTP_HOST=${APPFLOWY_MAILER_SMTP_HOST}
- APPFLOWY_MAILER_SMTP_PORT=${APPFLOWY_MAILER_SMTP_PORT}
- APPFLOWY_MAILER_SMTP_USERNAME=${APPFLOWY_MAILER_SMTP_USERNAME}
- APPFLOWY_MAILER_SMTP_EMAIL=${APPFLOWY_MAILER_SMTP_EMAIL}
- APPFLOWY_MAILER_SMTP_PASSWORD=${APPFLOWY_MAILER_SMTP_PASSWORD}
- APPFLOWY_MAILER_SMTP_TLS_KIND=${APPFLOWY_MAILER_SMTP_TLS_KIND}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Removal of APPFLOWY_MAILER_SMTP_TLS_KIND may cause issues for non-standard SMTP ports.

Relying on port-based inference for TLS mode may fail with SMTP providers that use non-standard ports or require explicit TLS settings.

- APPFLOWY_MAILER_SMTP_HOST=${SMTP_HOST}
- APPFLOWY_MAILER_SMTP_PORT=${SMTP_PORT}
- APPFLOWY_MAILER_SMTP_USERNAME=${SMTP_USER}
- APPFLOWY_MAILER_SMTP_EMAIL=${EMAIL_FROM}
- APPFLOWY_MAILER_SMTP_PASSWORD=${SMTP_PASSWORD}
- APPFLOWY_ACCESS_CONTROL=${APPFLOWY_ACCESS_CONTROL}
- APPFLOWY_DATABASE_MAX_CONNECTIONS=${APPFLOWY_DATABASE_MAX_CONNECTIONS}
- AI_SERVER_HOST=${AI_SERVER_HOST}
Expand Down Expand Up @@ -200,12 +195,11 @@ services:
- APPFLOWY_S3_SECRET_KEY=${APPFLOWY_S3_SECRET_KEY}
- APPFLOWY_S3_BUCKET=${APPFLOWY_S3_BUCKET}
- APPFLOWY_S3_REGION=${APPFLOWY_S3_REGION}
- APPFLOWY_MAILER_SMTP_HOST=${APPFLOWY_MAILER_SMTP_HOST}
- APPFLOWY_MAILER_SMTP_PORT=${APPFLOWY_MAILER_SMTP_PORT}
- APPFLOWY_MAILER_SMTP_USERNAME=${APPFLOWY_MAILER_SMTP_USERNAME}
- APPFLOWY_MAILER_SMTP_EMAIL=${APPFLOWY_MAILER_SMTP_EMAIL}
- APPFLOWY_MAILER_SMTP_PASSWORD=${APPFLOWY_MAILER_SMTP_PASSWORD}
- APPFLOWY_MAILER_SMTP_TLS_KIND=${APPFLOWY_MAILER_SMTP_TLS_KIND}
- APPFLOWY_MAILER_SMTP_HOST=${SMTP_HOST}
- APPFLOWY_MAILER_SMTP_PORT=${SMTP_PORT}
- APPFLOWY_MAILER_SMTP_USERNAME=${SMTP_USER}
- APPFLOWY_MAILER_SMTP_EMAIL=${EMAIL_FROM}
- APPFLOWY_MAILER_SMTP_PASSWORD=${SMTP_PASSWORD}
depends_on:
postgres:
condition: service_healthy
Expand Down
4 changes: 4 additions & 0 deletions docker/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginxinc/nginx-unprivileged:stable-alpine

COPY --chown=nginx nginx.conf /etc/nginx/conf.d/default.conf
COPY ssl/ /etc/nginx/ssl/
Loading