chore: update docker compose and env config for drizzle
- Replace Triplit env vars with PostgreSQL, auth, and S3 config - Add app service to docker-compose with healthcheck dependency - Bind ports to localhost only for security - Add required POSTGRES_PASSWORD validation
This commit is contained in:
+22
-6
@@ -1,6 +1,22 @@
|
||||
TRIPLIT_SERVICE_TOKEN="your-triplit-service-token" # given to you on startup, or by running `tsx generate-tokens.ts`
|
||||
NUXT_TRIPLIT_ANON_TOKEN="your-anonymous-triplit-token" # also given to you on startup, or by running `tsx generate-tokens.ts`
|
||||
BETTER_AUTH_SECRET="super-secret" # openssl rand -base64 32
|
||||
TRIPLIT_JWT_SECRET="super-secret"
|
||||
EXTERNAL_JWT_SECRET=${BETTER_AUTH_SECRET} # no need to change this
|
||||
NUXT_PUBLIC_TRIPLIT_URL="http://localhost:6543" # your triplit server url
|
||||
# Database
|
||||
POSTGRES_DB=veridian
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=changeme
|
||||
DATABASE_URL=postgresql://postgres:changeme@db:5432/veridian
|
||||
|
||||
# Auth
|
||||
BETTER_AUTH_SECRET=changeme
|
||||
|
||||
# App URL (your domain, used for CORS and auth redirects)
|
||||
NUXT_PUBLIC_URL=https://veridian.example.com
|
||||
|
||||
# S3-compatible storage (optional, for file uploads)
|
||||
S3_ACCESS_KEY_ID=
|
||||
S3_SECRET_ACCESS_KEY=
|
||||
S3_BUCKET_NAME=
|
||||
S3_REGION=
|
||||
S3_ENDPOINT=
|
||||
|
||||
# Auth controls (optional)
|
||||
DISABLE_SIGNUP=false
|
||||
DISABLE_LOCAL_AUTH=false
|
||||
|
||||
+31
-4
@@ -2,14 +2,41 @@ services:
|
||||
db:
|
||||
image: pgvector/pgvector:pg17
|
||||
container_name: veridian-db
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- "127.0.0.1:5432:5432"
|
||||
environment:
|
||||
POSTGRES_DB: veridian
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: ${POSTGRES_DB:-veridian}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-veridian}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
build: .
|
||||
container_name: veridian-app
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:3000:3000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-veridian}
|
||||
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:?Set BETTER_AUTH_SECRET in .env}
|
||||
NUXT_PUBLIC_URL: ${NUXT_PUBLIC_URL:?Set NUXT_PUBLIC_URL in .env}
|
||||
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-}
|
||||
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-}
|
||||
S3_BUCKET_NAME: ${S3_BUCKET_NAME:-}
|
||||
S3_REGION: ${S3_REGION:-}
|
||||
S3_ENDPOINT: ${S3_ENDPOINT:-}
|
||||
DISABLE_SIGNUP: ${DISABLE_SIGNUP:-}
|
||||
DISABLE_LOCAL_AUTH: ${DISABLE_LOCAL_AUTH:-}
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
|
||||
Reference in New Issue
Block a user