Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# either `google_genai`, `openai` (Logos) or `local`
PROVIDER=google_genai

# Google Gemini API key for the GenAI services — https://aistudio.google.com/apikey
# Google Gemini API keys for the GenAI services — https://aistudio.google.com/apikey
GEMINI_MODEL=gemini-3.1-flash-lite
GEMINI_HELP_SERVICE_KEY=
GEMINI_RECIPE_SERVICE_KEY=
Expand All @@ -16,11 +16,10 @@ LOCAL_BASE_URL=http://host.docker.internal:1234/v1
LOCAL_MODEL=google/gemma-4-e4b
LOCAL_KEY=not-needed

# Spring API (optional variables, if not defined in-memory db is automatically set up)
# DB_URL=jdbc:postgresql://host:5432/cooking
# Postgres database for Spring API (uncomment to override default values)
# DB_NAME=cookingdb
# DB_USER=postgres
# DB_PASSWORD=
# DB_PASSWORD=secretpass
# JWT_SECRET= # any string ≥ 32 chars
# JPA_DDL_AUTO=update # only set when using persistent db

INTERNAL_AUTH_SECRET=replaceThisWithYourSecret
284 changes: 0 additions & 284 deletions best_practices.md

This file was deleted.

32 changes: 30 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,43 @@ services:
- action: rebuild
path: ./.env

postgres:
image: postgres:16-alpine
restart: always
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-secretpass}
POSTGRES_DB: ${DB_NAME:-cookingdb}
expose:
- "5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-cookingdb}"]
interval: 5s
timeout: 5s
retries: 5

spring-api:
build: ./services/spring-api
ports:
- "8081:8080"
environment:
AI_RECIPE_SERVICE_URL: http://py-recipe-service:8080
AI_HELP_SERVICE_URL: http://py-help-service:8080
DB_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-cookingdb}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-secretpass}
JPA_DDL_AUTO: update
env_file:
- ./.env
depends_on:
- py-help-service
- py-recipe-service
postgres:
condition: service_healthy
py-help-service:
condition: service_started
py-recipe-service:
condition: service_started
develop:
watch:
- action: rebuild
Expand Down Expand Up @@ -99,3 +124,6 @@ services:
volumes:
- ./api/openapi.yaml:/usr/share/nginx/html/openapi/openapi.yaml:ro
- ./api/openapi-internal.yaml:/usr/share/nginx/html/openapi/openapi-internal.yaml:ro

volumes:
db-data:
4 changes: 2 additions & 2 deletions infra/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
- backend

postgres-db:
image: postgres:15-alpine
image: postgres:16-alpine
Comment thread
jschoedl marked this conversation as resolved.
restart: always
env_file: .env
environment:
Expand Down Expand Up @@ -86,4 +86,4 @@ services:
- spring-api

volumes:
db-data:
db-data:
2 changes: 1 addition & 1 deletion infra/k8s/namespace.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Two namespaces per best_practices.md:
# Two namespaces:
# app — all four microservices + database
# monitoring — Prometheus & Grafana (deployed separately, later)
#
Expand Down
Loading