Skip to content

Commit 405b164

Browse files
committed
Adds an example of docker compose for external database
1 parent 560ba4e commit 405b164

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

docs/config/external-db.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,41 @@ migrations, or if they were not executed for some reason, you can run them manua
7676
```
7777

7878
This command forcefully runs the migrations regardless of the current state, ensuring that all necessary tables are
79-
properly set up in the database.
79+
properly set up in the database.
80+
81+
## Docker compose example
82+
83+
Here’s an example of a `docker-compose.yml` file that sets up a PostgreSQL database for Buggregator:
84+
85+
```yaml
86+
version: '3.9'
87+
88+
services:
89+
buggregator:
90+
image: ghcr.io/buggregator/server:latest
91+
depends_on:
92+
buggregator-database:
93+
condition: service_healthy
94+
ports:
95+
- 127.0.0.1:8000:8000
96+
environment:
97+
PERSISTENCE_DRIVER: db
98+
DB_DRIVER: pgsql
99+
DB_DATABASE: buggregator
100+
DB_HOST: buggregator-database
101+
DB_PORT: 5432
102+
DB_USERNAME: root
103+
DB_PASSWORD: secret
104+
105+
buggregator-database:
106+
image: postgres:latest
107+
healthcheck:
108+
test: [ "CMD-SHELL", "pg_isready --username=buggregator --dbname=buggregator" ]
109+
interval: 3s
110+
timeout: 3s
111+
retries: 1
112+
environment:
113+
POSTGRES_DB: buggregator
114+
POSTGRES_USER: root
115+
POSTGRES_PASSWORD: secret
116+
```

0 commit comments

Comments
 (0)