From 70575f4e4a4b10d51415f7566edd6849414a4366 Mon Sep 17 00:00:00 2001 From: Foster Hangdaan Date: Fri, 13 Dec 2024 17:08:33 -0500 Subject: [PATCH] refactor: Add Postgres service --- .env.example | 15 +++++++++++++++ compose.yaml | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/.env.example b/.env.example index 85923ae..7e6e6e5 100644 --- a/.env.example +++ b/.env.example @@ -5,6 +5,12 @@ # Runtime environment. Valid values are: production, development. ROMDEX_ENV=development +# Database +ROMDEX_DB_HOST=romdex-db +ROMDEX_DB_USER=postgres +ROMDEX_DB_PASSWORD=postgres +ROMDEX_DB_DATABASE=postgres + ###### # Deno ###### @@ -17,3 +23,12 @@ DENO_DIR=/var/cache/deno ####### FRESH_NO_UPDATE_CHECK=true + +########## +# Postgres +########## + +POSTGRES_HOST=romdex-db +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgres +POSTGRES_DB=postgres diff --git a/compose.yaml b/compose.yaml index f14d202..13e3261 100644 --- a/compose.yaml +++ b/compose.yaml @@ -5,6 +5,8 @@ volumes: external: true deno-cache: external: true + romdex-db-data: + external: true services: romdex: @@ -29,3 +31,12 @@ services: - ./tailwind.config.ts:/app/tailwind.config.ts:ro - deno-cache:/var/cache/deno - romdex-data:/app/data + + romdex-db: + container_name: romdex-db + image: docker.io/library/postgres:17-alpine + env_file: .env.development.local + ports: + - "5432:5432" + volumes: + - romdex-db-data:/var/lib/postgresql/data