I want to use botpress with PostgreSQL.
Found on https://hub.docker.com/r/botpress/server
example
docker run --detach \
--name=botpress \
--publish 3000:8080 \
--volume botpress_data:/botpress/data \
--env PORT=8080 \ # Don't forget to adjust "--publish" then
--env BP_HOST=0.0.0.0 \ # all zeroes means listen to all interfaces
--env NODE_ENV=production \
--env PG_HOST=192.168.0.11 \
--env PG_PORT=5432 \
--env PG_USER=bp_user \
--env PG_PASSWORD=<********> \
--env PG_SSL=false \
botpress/server:latest
In my local env I run in Docker PostgreSQL
0d530862c5c3 postgres "docker-entrypoint.s…" 6 weeks ago Up 38 minutes 0.0.0.0:54320->5432/tcp postgresql_inclouds
In this DB I create user botpress and DB botpress and granted all privelegies to botpress user.
after I start in docker botpress
docker run --detach \
--name=botpres \
--net=inclouds_network \
--publish 3000:3000 \
--volume /opt/docker/botpress:/botpress/data \
--env BP_HOST=0.0.0.0 \
--env NODE_ENV=production \
--env PG_HOST=postgresql_inclouds \
--env PG_PORT=5432 \
--env PG_USER=botpress \
--env PG_PASSWORD=b0tpress \
--env PG_SSL=false \
botpress/server:v12_10_7
docker container with botpress started
webGUI is working
But botpress working with SQLite.
How to make it work with PostgreSQL DB?
If you need or want to use docker compose for botpress along with postgres there are a few things to keep in mind.
The docker-compose.yaml file:
The connection to postgre must be made in the .env file inside the container, for that we must map the file using a volume and place it in the correct location as shown in the service that I have called "botpressserver"
The .env file: In my case has 2 variables, the name of the database, and the connection string. Remember this file must be mapped by a volume to this location within the container
Database conexion string sintax:
Run it and enjoy it ;)
PD:I hope I can help someone