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
4 changes: 3 additions & 1 deletion .env.docker.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ TIMEZONE=Europe/Zagreb
# =================
HOST=0.0.0.0
PORT=8000
EXTERNAL_PORT=8000
ROOT_PATH=/
BASE_URL=http://localhost:8000
REDIRECT_URL=https://cijene.dev

Expand All @@ -47,4 +49,4 @@ DB_MAX_CONNECTIONS=20
# Docker: resolves to /app/data and /app/output (working dir is /app)
# Local: resolves to ./data and ./output (working dir is project root)
ARCHIVE_DIR=data
CRAWLER_OUTPUT_DIR=output
CRAWLER_OUTPUT_DIR=output
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
db:
image: postgres:17-alpine
image: postgres:16-alpine
env_file:
- .env
volumes:
Expand All @@ -27,12 +27,12 @@ services:
- ./data:/app/data
- ./enrichment:/app/enrichment
ports:
- "${PORT:-8000}:8000"
- "${EXTERNAL_PORT:-8000}:${PORT:-8000}"
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
test: ["CMD-SHELL", "curl -f http://localhost:${PORT:-8000}/health"]
interval: 30s
timeout: 10s
retries: 3
Expand All @@ -55,4 +55,4 @@ services:

volumes:
postgres_data:
driver: local
driver: local
1 change: 1 addition & 0 deletions service/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Settings:
def __init__(self):
self.version: str = os.getenv("VERSION", "0.1.0")
self.archive_dir: str = os.getenv("ARCHIVE_DIR", "data")
self.root_path: str = os.getenv("ROOT_PATH", "/")
self.base_url: str = os.getenv("BASE_URL", "https://api.cijene.dev")
self.host: str = os.getenv("HOST", "0.0.0.0")
self.port: int = int(os.getenv("PORT", "8000"))
Expand Down
1 change: 1 addition & 0 deletions service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ async def lifespan(app: FastAPI):
description="Service for product pricing data by Croatian grocery chains",
version=settings.version,
debug=settings.debug,
root_path=settings.root_path,
lifespan=lifespan,
openapi_components={
"securitySchemes": {"HTTPBearer": {"type": "http", "scheme": "bearer"}}
Expand Down