Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For 3 months been trying to install botpress for production, my end result is a blank white page for the chat bot URL's.
- So using docker is the way to get everything working correctly, installing botpress without ssl and without postgress is extremely easy, but we want production not some bs.
- Info:
- https://github.com/botpress/botpress/discussions/12393
- https://github.com/botpress/botpress/discussions/12135
- So install Nginx on another container or on the botpress container? Using Docker and Portainer
- Create 2 containers
- 1.
- docker run -d \
- --name postgres \
- -p 5432:5432 \
- -v pgdata:/var/lib/postgresql/data \
- --restart=always \
- -e PGPORT=5432 \
- -e POSTGRES_DB=botpress_db \
- -e POSTGRES_PASSWORD=dbpw \
- -e POSTGRES_USER=postgres \
- postgres:11.2-alpine;
- And I use this for Botpress:
- 2.
- docker run -d \
- --name botpress \
- -p 3000:3000 \
- -v botpress_data:/botpress/data \
- --restart=always \
- -e EXTERNAL_URL="${hostName}" \
- -e DATABASE_URL=postgres://postgres:[email protected]:5432/botpress_db \
- -e BPFS_STORAGE=database \
- -e BP_ADMIN_EMAIL=admin \
- -e BP_ADMIN_PASSWORD=adminPassword \
- -e AUTO_MIGRATE=true \
- botpress/server:latest;
- And for SSL we use a mix of NGINX and CertBot inside the vps where botpress is installed or on a new container?
- NGINX:
- events {
- worker_connections 1024;
- }
- http {
- upstream botpress-cluster {
- server localhost:3000;
- }
- server_tokens off;
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
- client_max_body_size 25M;
- proxy_cache_path /srv/nginx_cache levels=1:2 keys_zone=my_cache:10m max_size=10g
- inactive=60m use_temp_path=off;
- log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" '
- '\$status \$body_bytes_sent "\$http_referer" '
- '"\$http_user_agent" "\$http_x_forwarded_for"';
- access_log /access.log main;
- error_log /error.log;
- server {
- server_name ${hostName};
- # Enable caching of assets by NGINX to reduce load on the server
- location ~ .*/assets/.* {
- proxy_cache my_cache;
- proxy_ignore_headers Cache-Control;
- proxy_hide_header Cache-Control;
- proxy_hide_header Pragma;
- proxy_pass http://botpress-cluster;
- proxy_cache_valid any 30m;
- proxy_set_header Cache-Control max-age=30;
- add_header Cache-Control max-age=30;
- }
- location /socket.io/ {
- proxy_pass http://botpress-cluster/socket.io/;
- proxy_http_version 1.1;
- proxy_set_header Upgrade \$http_upgrade;
- proxy_set_header Connection "Upgrade";
- }
- location / {
- proxy_pass http://botpress-cluster;
- }}}
Advertisement
Add Comment
Please, Sign In to add comment