Setup simple docker-compose and .env to get database running

This commit is contained in:
GeorgeWebberley 2026-03-01 10:55:34 +01:00
parent c39e5dc06a
commit f93b9ca271
3 changed files with 28 additions and 0 deletions

9
.env.example Normal file
View file

@ -0,0 +1,9 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=pandektes
POSTGRES_PORT=5432
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/pandektes?schema=public"
PORT=3000
NODE_ENV=development

3
.gitignore vendored
View file

@ -54,3 +54,6 @@ pids
# Diagnostic reports (https://nodejs.org/api/report.html) # Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
/generated/prisma
src/schema.gql

16
docker-compose.yaml Normal file
View file

@ -0,0 +1,16 @@
services:
postgres:
image: postgres:16-alpine
container_name: pandektes-postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-yourPassword}
POSTGRES_DB: ${POSTGRES_DB:-pandektes}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data: