-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
73 lines (70 loc) · 2.37 KB
/
Copy pathdocker-compose.yml
File metadata and controls
73 lines (70 loc) · 2.37 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
# CEIT Library Laravel app + PostgreSQL — the front door of the AI assistant.
#
# Run together with the sidecar stack (ceit-ai-sidecar: docker compose up):
# the app reaches the sidecar through host.docker.internal:8310 by default
# (override SIDECAR_URL/SIDECAR_TOKEN in your .env).
#
# docker compose up --build
# open http://localhost:8080 (if the port is taken: APP_PORT=8081 docker compose up -d)
# demo login button on the login page (seeded student account)
#
# On first boot the app runs `migrate --seed` (creates the demo student
# account the login page's "Log in with demo student" button uses); later
# boots only migrate. The database is a local PostgreSQL 16 volume.
services:
app:
build: .
ports:
- "${APP_PORT:-8080}:80"
environment:
APP_ENV: local
APP_DEBUG: "true"
APP_URL: ${APP_URL:-http://localhost}
APP_KEY: ${APP_KEY:-}
QR_HMAC_SECRET: ${QR_HMAC_SECRET:-}
DB_CONNECTION: pgsql
DB_HOST: db
DB_PORT: "5432"
DB_DATABASE: ceit_library
DB_USERNAME: ceit
DB_PASSWORD: ceit
# SIDECAR_BASE_URL (not SIDECAR_URL) so the app's own .env can never
# shadow the container default. Point it at the sidecar host.
SIDECAR_URL: ${SIDECAR_BASE_URL:-http://host.docker.internal:8310}
SIDECAR_TOKEN: ${SIDECAR_TOKEN:-change-me}
volumes:
- app_storage:/var/www/html/storage
depends_on:
db:
condition: service_healthy
command: >
sh -c "if [ -z \"$${APP_KEY}\" ]; then
KEYFILE=/var/www/html/storage/app/.app_key;
if [ ! -f $$KEYFILE ]; then
php artisan key:generate --show > $$KEYFILE;
fi;
export APP_KEY=$$(cat $$KEYFILE);
fi;
if [ ! -f /var/www/html/storage/.seeded ]; then
php artisan migrate --seed --force &&
touch /var/www/html/storage/.seeded;
fi;
/bin/bash /var/www/html/Docker/start.sh"
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: ceit_library
POSTGRES_USER: ceit
POSTGRES_PASSWORD: ceit
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ceit -d ceit_library"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
volumes:
app_storage:
pgdata: