-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (96 loc) · 3.18 KB
/
docker-compose.yml
File metadata and controls
100 lines (96 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
version: '3.8'
services:
postgres:
image: pgvector/pgvector:pg16
container_name: magnet-postgres
restart: unless-stopped
env_file:
- .env
environment:
- POSTGRES_DB=${DB_NAME:-magnet_dev}
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_PASSWORD=${DB_PASSWORD:-password}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust}
ports:
- "${DB_PORT:-5433}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# Initialize pgvector extension
- ./api/scripts/sql/init-pgvector.sql:/docker-entrypoint-initdb.d/init-pgvector.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-magnet_dev}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- magnet-network
app:
build:
context: .
dockerfile: Dockerfile
args:
# Set to "false" to skip docs build for faster development builds
# Usage: docker-compose build --build-arg BUILD_DOCS=false
BUILD_DOCS: ${BUILD_DOCS:-true}
WEB_BASE_PATH: ${WEB_BASE_PATH:-/}
container_name: magnet-app
restart: unless-stopped
env_file:
- .env
environment:
- ENV=${ENV:-development}
# Database configuration (separate parameters)
- DB_TYPE=postgresql
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=${DB_NAME:-magnet_dev}
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-password}
# PGVector configuration (same as main DB)
- PGVECTOR_HOST=postgres
- PGVECTOR_PORT=5432
- PGVECTOR_DATABASE=${DB_NAME:-magnet_dev}
- PGVECTOR_USER=${DB_USER:-postgres}
- PGVECTOR_PASSWORD=${DB_PASSWORD:-password}
# Disable CONNECTION_STRING from .env (we use separate params)
- PGVECTOR_CONNECTION_STRING=
- DATABASE_URL=
# Runtime configuration
- RUN_MIGRATIONS=${RUN_MIGRATIONS:-true}
- RUN_FIXTURES=${RUN_FIXTURES:-false}
- RESET_DB=${RESET_DB:-false}
- PORT=5000
# Web configuration
- WEB_INCLUDED=true
- CORS_OVERRIDE_ALLOWED_ORIGINS=${CORS_OVERRIDE_ALLOWED_ORIGINS:-http://localhost:5000}
- AUTH_ENABLED=${AUTH_ENABLED:-true}
- WEB_AUTH_PROVIDER_TITLE=${WEB_AUTH_PROVIDER_TITLE:-Microsoft}
- WEB_AUTH_POPUP_WIDTH=${WEB_AUTH_POPUP_WIDTH:-600}
- WEB_AUTH_POPUP_HEIGHT=${WEB_AUTH_POPUP_HEIGHT:-400}
# Kreuzberg / OCR configuration
- USE_KREUZBERG=${USE_KREUZBERG:-true}
- KREUZBERG_OCR_BACKEND=${KREUZBERG_OCR_BACKEND:-tesseract}
- KREUZBERG_OCR_LANGUAGE=${KREUZBERG_OCR_LANGUAGE:-eng}
ports:
- "${PORT:-5000}:5000"
volumes:
- ./api/files:/app/files
# Mount migrations directory for persistence
- ./api/src/core/db/migrations:/app/src/core/db/migrations
# Copy fixtures management script
- ./api/manage_fixtures.py:/app/manage_fixtures.py:ro
# Mount static files for offline documentation
- ./api/static:/app/static:ro
depends_on:
postgres:
condition: service_healthy
networks:
- magnet-network
# Named volumes
volumes:
postgres_data:
driver: local
# Networks
networks:
magnet-network:
driver: bridge