-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompose.yaml
More file actions
90 lines (86 loc) · 2.44 KB
/
Copy pathcompose.yaml
File metadata and controls
90 lines (86 loc) · 2.44 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
# Ninots starter — default SQLite volume; optional Postgres / Redis via profiles
# Docs: README.md → Docker section
name: ninots
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "${PORT:-3000}:3000"
env_file:
- path: .env
required: false
environment:
APP_NAME: ${APP_NAME:-Ninots App}
APP_ENV: ${APP_ENV:-production}
APP_DEBUG: ${APP_DEBUG:-false}
APP_URL: ${APP_URL:-http://localhost:3000}
PORT: "3000"
HOSTNAME: "0.0.0.0"
DB_CONNECTION: ${DB_CONNECTION:-sqlite}
DB_HOST: ${DB_HOST:-127.0.0.1}
DB_PORT: ${DB_PORT:-5432}
DB_DATABASE: ${DB_DATABASE:-ninots}
DB_USERNAME: ${DB_USERNAME:-ninots}
DB_PASSWORD: ${DB_PASSWORD:-ninots}
CACHE_STORE: ${CACHE_STORE:-array}
SESSION_DRIVER: ${SESSION_DRIVER:-file}
CSRF_SECRET: ${CSRF_SECRET:-change-me-in-production}
QUEUE_CONNECTION: ${QUEUE_CONNECTION:-sync}
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
volumes:
- ninots-sqlite:/usr/src/app/storage
healthcheck:
test:
[
"CMD",
"bun",
"-e",
"const r = await fetch('http://127.0.0.1:3000/'); if (!r.ok) process.exit(1)",
]
interval: 5s
timeout: 5s
retries: 12
start_period: 15s
depends_on:
postgres:
condition: service_healthy
required: false
redis:
condition: service_healthy
required: false
# Optional: DB_CONNECTION=postgres DB_HOST=postgres docker compose --profile postgres up --build
postgres:
image: postgres:16-alpine
profiles: ["postgres"]
environment:
POSTGRES_DB: ${DB_DATABASE:-ninots}
POSTGRES_USER: ${DB_USERNAME:-ninots}
POSTGRES_PASSWORD: ${DB_PASSWORD:-ninots}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- ninots-postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
# Optional: SESSION_DRIVER=redis QUEUE_CONNECTION=redis docker compose --profile redis up --build
redis:
image: redis:7-alpine
profiles: ["redis"]
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- ninots-redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
volumes:
ninots-sqlite:
ninots-postgres:
ninots-redis: