mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
Allow custom microservices Postgres connection
This commit is contained in:
@@ -2,7 +2,7 @@ x-dorknet-service-env: &dorknet-service-env
|
||||
DORKNET_DOMAIN: ${DORKNET_DOMAIN:?Set DORKNET_DOMAIN in Dokploy}
|
||||
DORKNET_JWT_SECRET: ${DORKNET_JWT_SECRET:?Set DORKNET_JWT_SECRET in Dokploy}
|
||||
Database__Provider: postgres
|
||||
ConnectionStrings__Default: Host=postgres;Port=5432;Database=dorknet;Username=dorknet;Password=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in Dokploy}
|
||||
ConnectionStrings__Default: ${DORKNET_POSTGRES_CONNECTION_STRING:-Host=postgres;Port=5432;Database=dorknet;Username=dorknet;Password=${POSTGRES_PASSWORD:-dorknet_dev}}
|
||||
ConnectionStrings__Redis: redis:6379
|
||||
S3__Endpoint: ${DORKNET_S3_ENDPOINT:?Set DORKNET_S3_ENDPOINT in Dokploy}
|
||||
S3__AccessKey: ${DORKNET_S3_ACCESS_KEY:?Set DORKNET_S3_ACCESS_KEY in Dokploy}
|
||||
@@ -182,7 +182,7 @@ services:
|
||||
environment:
|
||||
POSTGRES_DB: dorknet
|
||||
POSTGRES_USER: dorknet
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in Dokploy}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-dorknet_dev}
|
||||
volumes:
|
||||
- microservices-postgres:/var/lib/postgresql/data
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ x-dorknet-service-env: &dorknet-service-env
|
||||
DORKNET_DOMAIN: ${DORKNET_DOMAIN:-localhost}
|
||||
DORKNET_JWT_SECRET: ${DORKNET_JWT_SECRET:-dorknet-dev-jwt-secret-000000000000000000000000000000000000000000}
|
||||
Database__Provider: postgres
|
||||
ConnectionStrings__Default: Host=postgres;Port=5432;Database=dorknet;Username=dorknet;Password=${POSTGRES_PASSWORD:-dorknet_dev}
|
||||
ConnectionStrings__Default: ${DORKNET_POSTGRES_CONNECTION_STRING:-Host=postgres;Port=5432;Database=dorknet;Username=dorknet;Password=${POSTGRES_PASSWORD:-dorknet_dev}}
|
||||
ConnectionStrings__Redis: redis:6379
|
||||
S3__Endpoint: ${DORKNET_S3_ENDPOINT:-}
|
||||
S3__AccessKey: ${DORKNET_S3_ACCESS_KEY:-}
|
||||
|
||||
@@ -165,6 +165,33 @@ POSTGRES_PASSWORD=replace-with-a-random-db-password
|
||||
CLOUDFLARE_TUNNEL_TOKEN=<token from Cloudflare Zero Trust tunnel>
|
||||
```
|
||||
|
||||
By default the service containers connect to the bundled compose
|
||||
Postgres service:
|
||||
|
||||
```env
|
||||
Host=postgres;Port=5432;Database=dorknet;Username=dorknet;Password=${POSTGRES_PASSWORD}
|
||||
```
|
||||
|
||||
To use a Dokploy-managed or external Postgres instead, set a full
|
||||
connection string and the compose services will use it instead of the
|
||||
bundled `postgres` hostname:
|
||||
|
||||
```env
|
||||
DORKNET_POSTGRES_CONNECTION_STRING=Host=<postgres-host>;Port=5432;Database=dorknet;Username=<user>;Password=<password>
|
||||
```
|
||||
|
||||
For hosted Postgres that requires TLS, include the Npgsql SSL options:
|
||||
|
||||
```env
|
||||
DORKNET_POSTGRES_CONNECTION_STRING=Host=<postgres-host>;Port=5432;Database=dorknet;Username=<user>;Password=<password>;SSL Mode=Require;Trust Server Certificate=true
|
||||
```
|
||||
|
||||
If you use the bundled compose Postgres, `POSTGRES_PASSWORD` must match
|
||||
the password that initialized the existing Postgres volume. Changing
|
||||
`POSTGRES_PASSWORD` later does not change the already-created `dorknet`
|
||||
database user; either restore the original password, reset it inside
|
||||
Postgres, or recreate the Postgres volume.
|
||||
|
||||
In Cloudflare Zero Trust, configure the tunnel with two public hostnames:
|
||||
|
||||
```text
|
||||
|
||||
Reference in New Issue
Block a user