-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (108 loc) · 3 KB
/
docker-compose.yml
File metadata and controls
115 lines (108 loc) · 3 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
services:
postgres:
image: postgres:16-alpine
ports:
- "5433:5432"
environment:
POSTGRES_DB: invoicescan
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d invoicescan"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ── Application (full profile) ────────────────────────────────────────────
# Run with: docker compose --profile full up
#
# Prerequisites:
# 1. Build images: docker compose --profile full build
# 2. Set .env at monorepo root with all required vars.
# 3. JWT_SECRET and JWT_REFRESH_SECRET must be ≥ 32 chars.
migrate:
profiles: [full]
build:
context: .
dockerfile: packages/backend/Dockerfile
target: build
# Override CMD to run migrations instead of starting the server
command: sh -c "node packages/backend/dist/run-migrations.js"
depends_on:
postgres:
condition: service_healthy
env_file: .env
environment:
NODE_ENV: production
app:
profiles: [full]
build:
context: .
dockerfile: packages/backend/Dockerfile
ports:
- "${PORT:-3000}:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
env_file: .env
environment:
NODE_ENV: production
volumes:
- uploads:/app/uploads
- exports:/app/exports
frontend:
profiles: [full]
build:
context: .
dockerfile: packages/frontend/Dockerfile
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3000}
ports:
- "3001:3001"
depends_on:
- app
environment:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3000}
# ── Observability (SigNoz) ─────────────────────────────────────────────
# Run only with: docker compose --profile observability up
# UI available at: http://localhost:3301
# OTLP HTTP endpoint: http://localhost:4318
#
# Set in .env:
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
# OTEL_SERVICE_NAME=invoice-flow-backend
signoz:
profiles: [observability]
image: signoz/signoz:latest
container_name: signoz
ports:
- "3301:3301" # SigNoz UI
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
environment:
- STORAGE=clickhouse
volumes:
- signozdata:/var/lib/signoz
volumes:
pgdata:
redisdata:
signozdata:
uploads:
exports: