2
0

docs: 📝 Improve docker guides and examples

This commit is contained in:
Baptiste Arnaud
2022-06-27 16:24:08 +02:00
parent 3600783439
commit d1e94ee562
7 changed files with 344 additions and 116 deletions

View File

@ -0,0 +1,4 @@
{
"label": "Configuration",
"position": 2
}

View File

@ -1,27 +1,12 @@
--- ---
sidebar_position: 2 title: Builder
--- ---
import { SponsorButton } from '../../src/js/SponsorButton.jsx' import { SponsorButton } from '../../../src/js/SponsorButton.jsx'
# Configuration # Builder configuration
:::note ## General
The easiest way to get started with Typebot is with [the official managed service in the Cloud](https://app.typebot.io). It takes 1 minute to try out the tool for free. You'll have high availability, backups, security, and maintenance all managed for you by me, Baptiste, Typebot's founder.
That's also the best way to support my work, open-source software, and you'll get great service!
:::
When running Typebot on your machine, the following configuration parameters can be supplied as environment variables.
Typebot is composed of 2 main applications:
- The builder, where you build your typebots
- The viewer, where your user answer the typebot
Both apps have their own environment config files. Here is an exhaustive list of all the parameters you can set:
## Builder
| Parameter | Default | Description | | Parameter | Default | Description |
| ---------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@ -33,8 +18,7 @@ Both apps have their own environment config files. Here is an exhaustive list of
| NEXTAUTH_URL_INTERNAL | -- | The internal builder base URL. You have to set it only when `NEXTAUTH_URL` isn't publicly accessible | | NEXTAUTH_URL_INTERNAL | -- | The internal builder base URL. You have to set it only when `NEXTAUTH_URL` isn't publicly accessible |
| DISABLE_SIGNUP | false | To disable new sign ups but still be able to sign in with existing users or admin email | | DISABLE_SIGNUP | false | To disable new sign ups but still be able to sign in with existing users or admin email |
<details><summary><h3>Email (Auth, notifications)</h3></summary> ## Email (Auth, notifications)
<p>
Used for sending email notifications and authentication Used for sending email notifications and authentication
@ -48,10 +32,7 @@ Used for sending email notifications and authentication
| SMTP_AUTH_DISABLED | false | To disable the authentication by email but still use the provided config for notifications | | SMTP_AUTH_DISABLED | false | To disable the authentication by email but still use the provided config for notifications |
| SMTP_IGNORE_TLS | false | Don't use TLS even if the server supports STARTTLS extension | | SMTP_IGNORE_TLS | false | Don't use TLS even if the server supports STARTTLS extension |
</p></details> ## Google (Auth, Sheets, Fonts)
<details><summary><h3>Google (Auth, Sheets, Fonts)</h3></summary>
<p>
Used authentication in the builder and for the Google Sheets integration step. Make sure to set the required scopes (`userinfo.email`, `spreadsheets`, `drive.readonly`) in your console Used authentication in the builder and for the Google Sheets integration step. Make sure to set the required scopes (`userinfo.email`, `spreadsheets`, `drive.readonly`) in your console
The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/google` The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/google`
@ -67,10 +48,7 @@ Used for Google Fonts:
| -------------------------- | ------- | --------------------------------------- | | -------------------------- | ------- | --------------------------------------- |
| NEXT_PUBLIC_GOOGLE_API_KEY | -- | The API Key from the Google API Console | | NEXT_PUBLIC_GOOGLE_API_KEY | -- | The API Key from the Google API Console |
</p></details> ## GitHub (Auth)
<details><summary><h3>GitHub (Auth)</h3></summary>
<p>
Used for authenticating with GitHub. By default, it uses the credentials of a Typebot-dev app. Used for authenticating with GitHub. By default, it uses the credentials of a Typebot-dev app.
@ -81,10 +59,7 @@ You can create your own GitHub OAuth app [here](https://github.com/settings/deve
| GITHUB_CLIENT_ID | -- | Application client ID. Also used to check if it is enabled in the front-end | | GITHUB_CLIENT_ID | -- | Application client ID. Also used to check if it is enabled in the front-end |
| GITHUB_CLIENT_SECRET | -- | Application secret | | GITHUB_CLIENT_SECRET | -- | Application secret |
</p></details> ## GitLab (Auth)
<details><summary><h3>GitLab (Auth)</h3></summary>
<p>
Used for authenticating with GitLab. Used for authenticating with GitLab.
Follow the official GitLab guide for creating OAuth2 applications [here](https://docs.gitlab.com/ee/integration/oauth_provider.html). Follow the official GitLab guide for creating OAuth2 applications [here](https://docs.gitlab.com/ee/integration/oauth_provider.html).
@ -98,10 +73,7 @@ The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/gitlab
| GITLAB_REQUIRED_GROUPS | -- | Comma-separated list of groups the user has to be a direct member of, e.g. `foo,bar` | | GITLAB_REQUIRED_GROUPS | -- | Comma-separated list of groups the user has to be a direct member of, e.g. `foo,bar` |
| GITLAB_NAME | GitLab | Name of the GitLab instance, used for the SSO Login Button | | GITLAB_NAME | GitLab | Name of the GitLab instance, used for the SSO Login Button |
</p></details> ## Facebook (Auth)
<details><summary><h3>Facebook (Auth)</h3></summary>
<p>
You can create your own Facebook OAuth app [here](https://developers.facebook.com/apps/create/). You can create your own Facebook OAuth app [here](https://developers.facebook.com/apps/create/).
The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/facebook` The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/facebook`
@ -111,10 +83,7 @@ The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/facebo
| FACEBOOK_CLIENT_ID | -- | Application client ID. Also used to check if it is enabled in the front-end | | FACEBOOK_CLIENT_ID | -- | Application client ID. Also used to check if it is enabled in the front-end |
| FACEBOOK_CLIENT_SECRET | -- | Application secret | | FACEBOOK_CLIENT_SECRET | -- | Application secret |
</p></details> ## Azure AD (Auth)
<details><summary><h3>Azure AD (Auth)</h3></summary>
<p>
If you are using [Azure Active Directory](https://azure.microsoft.com/en-us/services/active-directory/) for the authentication you can set the following environment variables. If you are using [Azure Active Directory](https://azure.microsoft.com/en-us/services/active-directory/) for the authentication you can set the following environment variables.
The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/azure-ad` The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/azure-ad`
@ -125,10 +94,7 @@ The Authorization callback URL should be `$NEXTAUTH_URL/api/auth/callback/azure-
| AZURE_AD_CLIENT_SECRET | -- | Application client secret. Can be obtained from Azure Portal. | | AZURE_AD_CLIENT_SECRET | -- | Application client secret. Can be obtained from Azure Portal. |
| AZURE_AD_TENANT_ID | -- | Azure Tenant ID | | AZURE_AD_TENANT_ID | -- | Azure Tenant ID |
</p></details> ## S3 Storage (Media uploads)
<details><summary><h3>S3 Storage (Media uploads)</h3></summary>
<p>
Used for uploading images, videos, etc... It can be any S3 compatible object storage service (Minio, Digital Oceans Space, AWS S3...) Used for uploading images, videos, etc... It can be any S3 compatible object storage service (Minio, Digital Oceans Space, AWS S3...)
@ -172,10 +138,7 @@ You also need to configure CORS so that an object can be uploaded from the brows
] ]
``` ```
</p></details> ## Giphy (GIF picker)
<details><summary><h3>Giphy (GIF picker)</h3></summary>
<p>
Used to search for GIF. You can create a Giphy app [here](https://developers.giphy.com/dashboard/) Used to search for GIF. You can create a Giphy app [here](https://developers.giphy.com/dashboard/)
@ -183,9 +146,9 @@ Used to search for GIF. You can create a Giphy app [here](https://developers.gip
| ------------------------- | ------- | ------------- | | ------------------------- | ------- | ------------- |
| NEXT_PUBLIC_GIPHY_API_KEY | -- | Giphy API key | | NEXT_PUBLIC_GIPHY_API_KEY | -- | Giphy API key |
</p></details> ## Others
<details><summary><h3>Others</h3></summary> <details><summary><h3>Show</h3></summary>
<p> <p>
The [official Typebot managed service](https://app.typebot.io/) uses other services such as [Stripe](https://stripe.com/) for processing payments, [Sentry](https://sentry.io/) for tracking bugs and [Sleekplan](https://sleekplan.com/) for user feedbacks. The [official Typebot managed service](https://app.typebot.io/) uses other services such as [Stripe](https://stripe.com/) for processing payments, [Sentry](https://sentry.io/) for tracking bugs and [Sleekplan](https://sleekplan.com/) for user feedbacks.
@ -252,62 +215,6 @@ These can also be added to the `viewer` environment
</p></details> </p></details>
## Viewer
| Parameter | Default | Description |
| ---------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DATABASE_URL | postgresql://postgres:typebot@db:5432/typebot | The database URL |
| ENCRYPTION_SECRET | SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6 | A 256-bit key used to encrypt sensitive data. It is strongly recommended to [generate](https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx) a new one. |
| NEXTAUTH_URL | http://localhost:3000 | The builder base URL. Should be the publicly accessible URL (i.e. `https://typebot.domain.com`) |
| NEXT_PUBLIC_VIEWER_URL | http://localhost:3001 | The viewer base URL. Should be the publicly accessible URL (i.e. `https://bot.domain.com`) |
<details><summary><h3>Emails (Notifications)</h3></summary>
<p>
Used for sending email notifications and authentication
| Parameter | Default | Description |
| --------------- | ------- | ------------------------------------------------------------------------------- |
| SMTP_USERNAME | -- | SMTP username |
| SMTP_PASSWORD | -- | SMTP password |
| SMTP_HOST | -- | SMTP host. (i.e. `smtp.host.com`) |
| SMTP_PORT | 25 | SMTP port |
| SMTP_FROM | - | From name and email (i.e. `'Typebot Notifications' <notifications@typebot.io>`) |
| SMTP_IGNORE_TLS | false | Don't use TLS even if the server supports STARTTLS extension |
</p></details>
<details><summary><h3>Google (Sheets)</h3></summary>
<p>
Used when executing a Google Sheets block. Make sure to set the required scopes (`userinfo.email`, `spreadsheets`, `drive.readonly`) in your console
| Parameter | Default | Description |
| -------------------- | ------- | --------------------------------------------- |
| GOOGLE_CLIENT_ID | -- | The Client ID from the Google API Console |
| GOOGLE_CLIENT_SECRET | -- | The Client secret from the Google API Console |
</p></details>
<details><summary><h3>S3 Storage (File upload input)</h3></summary>
<p>
Used for the file upload input. It can be any S3 compatible object storage service (Minio, Digital Oceans Space, AWS S3...)
| Parameter | Default | Description |
| ------------- | ------- | -------------------------------------------------------------- |
| S3_ACCESS_KEY | -- | S3 access key. Also used to check if upload feature is enabled |
| S3_SECRET_KEY | -- | S3 secret key. |
| S3_BUCKET | typebot | Name of the bucket where assets will be uploaded in. |
| S3_PORT | -- | S3 Host port number |
| S3_ENDPOINT | -- | S3 secret key. |
| S3_SSL | true | Use SSL when establishing the connection. |
| S3_REGION | -- | S3 region. |
Your bucket must have the following policy that tells S3 to allow public read when an object is located under the public folder:
</p></details>
:::note :::note
If you're self-hosting Typebot, [sponsoring me](https://github.com/sponsors/baptisteArno) is a great way to give back to the community and to contribute to the long-term sustainability of the project. If you're self-hosting Typebot, [sponsoring me](https://github.com/sponsors/baptisteArno) is a great way to give back to the community and to contribute to the long-term sustainability of the project.

View File

@ -0,0 +1,25 @@
---
sidebar_position: 1
title: Overview
slug: /self-hosting/configuration
---
# Configuration
:::note
The easiest way to get started with Typebot is with [the official managed service in the Cloud](https://app.typebot.io). It takes 1 minute to try out the tool for free. You'll have high availability, backups, security, and maintenance all managed for you by me, Baptiste, Typebot's founder.
That's also the best way to support my work, open-source software, and you'll get great service!
:::
When running Typebot on your machine, the following configuration parameters can be supplied as environment variables.
Typebot is composed of 2 main applications:
- The builder, where you build your typebots
- The viewer, where your user answer the typebot
Both apps have their environment to configure properly:
- [Builder configuration](/self-hosting/configuration/builder)
- [Viewer configuration](/self-hosting/configuration/viewer)

View File

@ -0,0 +1,93 @@
---
title: Viewer
---
import { SponsorButton } from '../../../src/js/SponsorButton.jsx'
# Viewer configuration
## General
| Parameter | Default | Description |
| ---------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DATABASE_URL | postgresql://postgres:typebot@db:5432/typebot | The database URL |
| ENCRYPTION_SECRET | SgVkYp2s5v8y/B?E(H+MbQeThWmZq4t6 | A 256-bit key used to encrypt sensitive data. It is strongly recommended to [generate](https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx) a new one. The secret should be the same between builder and viewer. |
| ADMIN_EMAIL | -- | The email that will get a "Pro" plan on user creation |
| NEXTAUTH_URL | http://localhost:3000 | The builder base URL. Should be the publicly accessible URL (i.e. `https://typebot.domain.com`) |
| NEXT_PUBLIC_VIEWER_URL | http://localhost:3001 | The viewer base URL. Should be the publicly accessible URL (i.e. `https://bot.domain.com`) |
| NEXTAUTH_URL_INTERNAL | -- | The internal builder base URL. You have to set it only when `NEXTAUTH_URL` isn't publicly accessible |
| DISABLE_SIGNUP | false | To disable new sign ups but still be able to sign in with existing users or admin email |
## Emails (Notifications)
Used for sending email notifications and authentication
| Parameter | Default | Description |
| --------------- | ------- | ------------------------------------------------------------------------------- |
| SMTP_USERNAME | -- | SMTP username |
| SMTP_PASSWORD | -- | SMTP password |
| SMTP_HOST | -- | SMTP host. (i.e. `smtp.host.com`) |
| SMTP_PORT | 25 | SMTP port |
| SMTP_FROM | - | From name and email (i.e. `'Typebot Notifications' <notifications@typebot.io>`) |
| SMTP_IGNORE_TLS | false | Don't use TLS even if the server supports STARTTLS extension |
## Google (Sheets)
Used when executing a Google Sheets block. Make sure to set the required scopes (`userinfo.email`, `spreadsheets`, `drive.readonly`) in your console
| Parameter | Default | Description |
| -------------------- | ------- | --------------------------------------------- |
| GOOGLE_CLIENT_ID | -- | The Client ID from the Google API Console |
| GOOGLE_CLIENT_SECRET | -- | The Client secret from the Google API Console |
## S3 Storage (File upload input)
Used for the file upload input. It can be any S3 compatible object storage service (Minio, Digital Oceans Space, AWS S3...)
| Parameter | Default | Description |
| ------------- | ------- | -------------------------------------------------------------- |
| S3_ACCESS_KEY | -- | S3 access key. Also used to check if upload feature is enabled |
| S3_SECRET_KEY | -- | S3 secret key. |
| S3_BUCKET | typebot | Name of the bucket where assets will be uploaded in. |
| S3_PORT | -- | S3 Host port number |
| S3_ENDPOINT | -- | S3 secret key. |
| S3_SSL | true | Use SSL when establishing the connection. |
| S3_REGION | -- | S3 region. |
Your bucket must have the following policy that tells S3 to allow public read when an object is located under the public folder:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<BUCKET_NAME>/public/*"
}
]
}
```
You also need to configure CORS so that an object can be uploaded from the browser:
```json
[
{
"AllowedHeaders": ["*"],
"AllowedMethods": ["PUT", "POST"],
"AllowedOrigins": ["*"],
"ExposeHeaders": ["ETag"]
}
]
```
:::note
If you're self-hosting Typebot, [sponsoring me](https://github.com/sponsors/baptisteArno) is a great way to give back to the community and to contribute to the long-term sustainability of the project.
<SponsorButton />
Thank you for supporting independent creators of Free Open Source Software!
:::

View File

@ -14,7 +14,7 @@ That's also the best way to support my work, open-source software, and you'll ge
## Requirements ## Requirements
You need a server with Docker installed. If your server doesn't come with Docker pre-installed, you can follow [their docs](https://docs.docker.com/get-docker/) to install it. You need a server with Docker installed. If your server doesn't come with Docker pre-installed, you can follow [their docs](https://docs.docker.com/engine/install/#server) to install it.
## Installation ## Installation
@ -86,7 +86,7 @@ By default, Typebot runs on unencrypted HTTP on ports 8080 for the builder and 8
If your DNS is managed by a service that offers a proxy option with automatic SSL management, feel free to use that. For example, you could use Cloudflare as a reverse proxy in front of Typebot. If your DNS is managed by a service that offers a proxy option with automatic SSL management, feel free to use that. For example, you could use Cloudflare as a reverse proxy in front of Typebot.
Alternatively, you can run your own Caddy server as a reverse proxy. This way your SSL certificate will be stored on the host machine and managed by Let's Encrypt. The Caddy server will expose port 443, terminate SSL traffic and proxy the requests to your Typebot server. Alternatively, you can run your Caddy server as a reverse proxy. This way your SSL certificate will be stored on the host machine and managed by Let's Encrypt. The Caddy server will expose port 443, terminate SSL traffic and proxy the requests to your Typebot server.
Here is an example of a docker-compose file using Caddy as a reverse proxy: Here is an example of a docker-compose file using Caddy as a reverse proxy:
@ -110,13 +110,13 @@ services:
typebot-builder: typebot-builder:
labels: labels:
virtual.host: 'typebot.domain.com' # change to your domain name virtual.host: 'typebot.domain.com' # change to your domain name
virtual.port: '8080' virtual.port: '3000'
virtual.tls-email: 'admin@example.com' # change to your email virtual.tls-email: 'admin@example.com' # change to your email
typebot-viewer: typebot-viewer:
labels: labels:
virtual.host: 'bot.domain.com' # change to your domain name virtual.host: 'bot.domain.com' # change to your domain name
virtual.port: '8081' virtual.port: '3000'
virtual.tls-email: 'admin@example.com' # change to your email virtual.tls-email: 'admin@example.com' # change to your email
volumes: volumes:
@ -124,10 +124,19 @@ volumes:
driver: local driver: local
``` ```
You can merge this compose file with the first one. It should automatically enable SSL on your server and you should be able to navigate to: This config requires you to add the following DNS entry:
- `https://typebot.domain.com` ```
- `https://bot.domain.com` typebot IN A <server_ip>
bot IN A <server_ip>
```
You can merge this compose file with the first one. Make sure that `NEXTAUTH_URL` is set to `https://typebot.domain.com` and `NEXT_PUBLIC_VIEWER_URL` is set to `https://bot.domain.com`.
When running the compose file, it should automatically enable SSL on your server and you should be able to navigate to:
- `https://typebot.domain.com` for the builder
- `https://bot.domain.com` for the viewer
#### Existing reverse proxy #### Existing reverse proxy
@ -136,6 +145,196 @@ If you're already running a reverse proxy, the most important things to note are
1. Configure the virtual hosts to match the `NEXTAUTH_URL` and `NEXT_PUBLIC_VIEWER_URL` in your `docker-compose` configuration. 1. Configure the virtual hosts to match the `NEXTAUTH_URL` and `NEXT_PUBLIC_VIEWER_URL` in your `docker-compose` configuration.
2. Proxy the traffic to `127.0.0.1:8080` or `{ip-address}:8080` and to `127.0.0.1:8081` or `{ip-address}:8081` if running on a remote machine 2. Proxy the traffic to `127.0.0.1:8080` or `{ip-address}:8080` and to `127.0.0.1:8081` or `{ip-address}:8081` if running on a remote machine
### SMTP
I highly recommend using an external SMTP service. There are tons of options out there, including [SendInBlue](https://www.sendinblue.com/), [Mailgun](https://www.mailgun.com/) and [SendGrid](https://sendgrid.com/). It will avoid severe headaches 😅. Then, you will only need to add the required [SMTP configuration variables](/self-hosting/configuration/builder#email-auth-notifications).
If, however, you don't want to, you can instantiate an SMTP server in the docker-compose file.
```yml
version: '3.3'
services:
mail:
image: bytemark/smtp
restart: always
typebot-builder:
environment:
- SMTP_HOST=mail
- NEXT_PUBLIC_SMTP_FROM=notifications@typebot.domain.com # change to your domain name
typebot-viewer:
- SMTP_HOST=mail
- NEXT_PUBLIC_SMTP_FROM=notifications@typebot.domain.com # change to your domain name
```
You will probably need to make sure that `typebot.domain.com` has a valid SPF record and that your server IP has a rDNS set up.
You can merge this compose file with the main one.
### S3 storage
If you don't already have an S3 storage available, you could include it in your docker-compose file:
```yml
version: '3.3'
services:
minio:
image: minio/minio
command: server /data
ports:
- '9000:9000'
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
volumes:
- s3_data:/data
# This service just makes sure a bucket with the right policies is created
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 10;
/usr/bin/mc config host add minio http://minio:9000 minio minio123;
/usr/bin/mc mb minio/typebot;
/usr/bin/mc policy set public minio/typebot/public;
exit 0;
"
typebot-builder:
environment:
- S3_ACCESS_KEY=minio
- S3_SECRET_KEY=minio123
- S3_BUCKET=typebot
- S3_ENDPOINT=storage.domain.com # change to your domain name
typebot-viewer:
environment:
- S3_ACCESS_KEY=minio
- S3_SECRET_KEY=minio123
- S3_BUCKET=typebot
- S3_ENDPOINT=storage.domain.com # change to your domain name
volumes:
s3_data:
```
This config requires you to add the following DNS entry:
```
storage IN A <server_ip>
```
You can merge this compose file with the main one.
## Config example with all the extras
Here is a config example that spins up Typebot with HTTPS, SMTP and S3 storage.
```yml
version: '3.3'
services:
caddy-gen:
image: 'wemakeservices/caddy-gen:latest'
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- caddy-certificates:/data/caddy
ports:
- '80:80'
- '443:443'
depends_on:
- typebot-builder
- typebot-viewer
typebot-db:
image: postgres:13
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=typebot
- POSTGRES_PASSWORD=typebot
typebot-builder:
labels:
virtual.host: 'typebot.domain.com' # change to your domain
virtual.port: '3000'
virtual.tls-email: 'admin@example.com' # change to your email
image: baptistearno/typebot-builder:latest
restart: always
depends_on:
- typebot-db
ports:
- '8080:3000'
extra_hosts:
- 'host.docker.internal:host-gateway'
# See https://docs.typebot.io/self-hosting/configuration for more configuration options
environment:
- DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot
- NEXTAUTH_URL=https://typebot.domain.com
- NEXT_PUBLIC_VIEWER_URL=https://bot.domain.com
- ENCRYPTION_SECRET=Tz9sL3FBc+XnO86KS9ScPuYj79Y4rII/Ie+FkaNNUrk=
- ADMIN_EMAIL=baptiste.arnaud95@gmail.com
- SMTP_HOST=mail
- NEXT_PUBLIC_SMTP_FROM=notifications@typebot.domain.com
- S3_ACCESS_KEY=minio
- S3_SECRET_KEY=minio123
- S3_BUCKET=typebot
- S3_ENDPOINT=storage.domain.com
typebot-viewer:
labels:
virtual.host: 'bot.domain.com' # change to your domain
virtual.port: '3000'
virtual.tls-email: 'admin@example.com' # change to your email
image: baptistearno/typebot-viewer:latest
restart: always
ports:
- '8081:3000'
# See https://docs.typebot.io/self-hosting/configuration for more configuration options
environment:
- DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot
- NEXT_PUBLIC_VIEWER_URL=https://bot.domain.com
- ENCRYPTION_SECRET=Tz9sL3FBc+XnO86KS9ScPuYj79Y4rII/Ie+FkaNNUrk=
- SMTP_HOST=mail
- NEXT_PUBLIC_SMTP_FROM=notifications@typebot.domain.com
- S3_ACCESS_KEY=minio
- S3_SECRET_KEY=minio123
- S3_BUCKET=typebot
- S3_ENDPOINT=storage.domain.com
mail:
image: bytemark/smtp
restart: always
minio:
labels:
virtual.host: 'storage.domain.com' # change to your domain
virtual.port: '9000'
virtual.tls-email: 'admin@example.com' # change to your email
image: minio/minio
command: server /data
ports:
- '9000:9000'
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
volumes:
- s3_data:/data
# This service just make sure a bucket with the right policies is created
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 10;
/usr/bin/mc config host add minio http://minio:9000 minio minio123;
/usr/bin/mc mb minio/typebot;
/usr/bin/mc policy set public minio/typebot/public;
exit 0;
"
volumes:
db_data:
s3_data:
caddy-certificates:
driver: local
```
:::note :::note
If you're self-hosting Typebot, [sponsoring me](https://github.com/sponsors/baptisteArno) is a great way to give back to the community and to contribute to the long-term sustainability of the project. If you're self-hosting Typebot, [sponsoring me](https://github.com/sponsors/baptisteArno) is a great way to give back to the community and to contribute to the long-term sustainability of the project.

View File

@ -1,4 +1,4 @@
version: '3.6' version: '3.3'
services: services:
postgres: postgres:
image: postgres:13 image: postgres:13

View File

@ -1,4 +1,4 @@
version: '3.9' version: '3.3'
services: services:
typebot-db: typebot-db:
image: postgres:13 image: postgres:13