From 6aafe3ff6ffca69fa73ffcff98f9b5a944e5307d Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Tue, 13 Oct 2026 07:12:38 -0500 Subject: [PATCH] feat(infra): optimize PostGIS/pgvector container and track environment template - Refactor docker/postgres/Dockerfile to build on pgvector:pg17 with postgresql-17-postgis-3. - Fix .gitignore rule to cleanly track .env.example. - Add .env.example with local database, auth, and PGAdmin configuration templates. --- .env.example | 19 +++++++++++++++++++ .gitignore | 4 ++-- docker/postgres/Dockerfile | 16 ++++------------ 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7f73bfe --- /dev/null +++ b/.env.example @@ -0,0 +1,19 @@ +# PostgreSQL Database Configuration +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgres +POSTGRES_DB=novias_db +DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/novias_db + +# PGAdmin Configuration +PGADMIN_EMAIL=admin@example.com +PGADMIN_PASSWORD=admin + +# JWT & Authentication +JWT_SECRET=development_insecure_jwt_secret_change_me +JWT_ALGORITHM=HS256 +ACCESS_TOKEN_EXPIRE_MINUTES=1440 + +# SSO Google OAuth (Optional in development / MockDevAdapter active) +GOOGLE_CLIENT_ID= +GOOGLE_CLIENT_SECRET= +GOOGLE_REDIRECT_URI=http://localhost:8000/v1/auth/callback diff --git a/.gitignore b/.gitignore index d007c0c..3b8e190 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ __pycache__/ .mypy_cache/ .env -.env.* -!.env.example # Keep templates tracked +# Keep templates tracked +!.env.example *.pem *.key client_secret*.json diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile index 01ba5cd..02ce51b 100644 --- a/docker/postgres/Dockerfile +++ b/docker/postgres/Dockerfile @@ -1,18 +1,10 @@ -FROM postgis/postgis:17-3.5 +FROM pgvector/pgvector:pg17 -# Install build dependencies and pgvector +# Install official PostGIS 3 for PostgreSQL 17 RUN apt-get update && \ apt-get install -y --no-install-recommends \ - postgresql-17-pgvector || \ - (apt-get install -y --no-install-recommends git build-essential postgresql-server-dev-17 && \ - cd /tmp && \ - git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git && \ - cd pgvector && \ - make && \ - make install && \ - apt-get remove -y git build-essential postgresql-server-dev-17 && \ - apt-get autoremove -y && \ - rm -rf /tmp/pgvector) && \ + postgresql-17-postgis-3 \ + postgresql-17-postgis-3-scripts && \ rm -rf /var/lib/apt/lists/* COPY docker/postgres/init-extensions.sql /docker-entrypoint-initdb.d/01-init-extensions.sql