-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.dev.yaml
More file actions
158 lines (141 loc) · 4.35 KB
/
docker-compose.dev.yaml
File metadata and controls
158 lines (141 loc) · 4.35 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: directus-hosting
services:
database:
image: postgres:17
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- ./docker/postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4:latest
environment:
PGADMIN_DEFAULT_EMAIL: admin@example.com
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "8080:80"
volumes:
- ./docker/pgadmin_data:/var/lib/pgadmin
depends_on:
database:
condition: service_healthy
restart: always
cache:
image: redis:8.0
restart: always
volumes:
- ./docker/redis_data:/data
healthcheck:
test: ["CMD-SHELL", "[ $$(redis-cli ping) = 'PONG' ]"]
interval: 10s
timeout: 5s
retries: 5
start_interval: 5s
start_period: 30s
mailhog:
image: mailhog/mailhog
ports:
- "1025:1025" # SMTP port
- "8025:8025" # Web UI port
restart: always
localstack:
image: localstack/localstack:latest
ports:
- "4566:4566"
environment:
- SERVICES=s3
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_DEFAULT_REGION=us-east-1
volumes:
- ./docker/localstack_data:/var/lib/localstack
- ./scripts/docker-init:/etc/localstack/init/ready.d
directus:
image: directus/directus:latest
ports:
- ${DIRECTUS_PORT}:8055
volumes:
- ./schema:/directus/schema
- ./extensions:/directus/extensions
- ./migrations:/directus/migrations
- ./templates:/directus/templates
- ./uploads:/directus/uploads
depends_on:
cache:
condition: service_healthy
database:
condition: service_healthy
mailhog:
condition: service_started
localstack:
condition: service_started
environment:
SECRET: ${DIRECTUS_SECRET}
DB_CLIENT: "pg"
DB_HOST: database
DB_PORT: ${DB_PORT:-5432}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
SYNCHRONIZATION_STORE: "redis"
REDIS_HOST: cache
REDIS_PORT: 6379
REDIS_URL: "redis://cache:6379"
CACHE_ENABLED: ${CACHE_ENABLED:-true}
CACHE_STORE: "redis"
CACHE_REDIS: "redis://cache:6379"
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
PUBLIC_URL: ${PUBLIC_URL}
# Storage Configuration - Using Local Storage
STORAGE_LOCATIONS: "local"
STORAGE_LOCAL_ROOT: "./uploads"
# Email Configuration (points to MailHog)
EMAIL_TRANSPORT: smtp
EMAIL_FROM: noreply@example.com
EMAIL_SMTP_HOST: mailhog
EMAIL_SMTP_PORT: 1025
EMAIL_SMTP_SECURE: false
# Other Settings
CORS_ENABLED: ${CORS_ENABLED:-true}
CORS_ORIGIN: ${CORS_ORIGIN:-true}
EXTENSIONS_PATH: /directus/extensions
MIGRATIONS_PATH: /directus/migrations
EXTENSIONS_AUTO_RELOAD: ${EXTENSIONS_AUTO_RELOAD:-true}
REFRESH_TOKEN_COOKIE_SECURE: false
SESSION_COOKIE_SECURE: false
# Files & Assets Configuration
FILES_MAX_UPLOAD_SIZE: "100mb"
ASSETS_CACHE_TTL: "30m"
ASSETS_TRANSFORM_MAX_CONCURRENT: 25
WEBSOCKETS_ENABLED: ${WEBSOCKETS_ENABLED:-true}
# Sepay Configuration
SEPAY_BANK_ACC: ${SEPAY_BANK_ACC}
SEPAY_BANK_CODE: ${SEPAY_BANK_CODE}
SEPAY_QR_BASE: ${SEPAY_QR_BASE}
# Content Security Policy
CONTENT_SECURITY_POLICY: "true"
CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC: ${CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC}
ASSETS_CONTENT_SECURITY_POLICY_DIRECTIVES__MEDIA_SRC: ${ASSETS_CONTENT_SECURITY_POLICY_DIRECTIVES__MEDIA_SRC}
ASSETS_CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC: ${ASSETS_CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC}
command: >
sh -c "
npx directus bootstrap &&
for file in /directus/schema/*.json; do
if [ -f \"$$file\" ]; then
echo \"Applying schema from $$file...\";
(npx directus schema apply --yes \"$$file\" || true);
fi
done &&
echo \"All schemas applied. Starting Directus...\" &&
npx directus start
"