This commit is contained in:
2025-10-24 02:08:25 +02:00
parent 72df3dec3b
commit f7a3e3f0f8
54 changed files with 333 additions and 682 deletions
+33 -14
View File
@@ -10,19 +10,19 @@ services:
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U papercrate"]
test: ["CMD-SHELL", "pg_isready -U papercrate -d papercrate_test"]
interval: 5s
timeout: 5s
retries: 5
quickwit:
quickwit-test:
image: quickwit/quickwit:0.8.2
command: ["run"]
environment:
QW_ENABLE_API_AUTH: "false"
QW_DATA_DIR: /quickwit/data
ports:
- "7280:7280"
- "7281:7280"
volumes:
- quickwit_test_data:/quickwit/data
healthcheck:
@@ -31,21 +31,40 @@ services:
timeout: 5s
retries: 5
quickwit-create-index:
image: quickwit/quickwit:0.8.2
admin-bootstrap:
build:
context: ./backend
depends_on:
quickwit:
postgres-test:
condition: service_healthy
quickwit-test:
condition: service_healthy
volumes:
- quickwit_test_data:/quickwit/data
- ./quickwit/documents-index.yaml:/tmp/documents-index.yaml:ro
environment:
QW_DATA_DIR: /quickwit/data
QW_NODE_URI: http://quickwit:7280
entrypoint: ["/bin/sh", "-c"]
DATABASE_URL: postgres://papercrate:papercrate_test@postgres-test:5432/papercrate_test
DATABASE_MAX_POOL_SIZE: 1
S3_BUCKET: documents
JWT_SECRET: change-me-super-secret
QUICKWIT_ENDPOINT: http://quickwit-test:7280
DEFAULT_TENANT_SLUG: admin
entrypoint: []
command: >
quickwit index list --node-uri http://quickwit:7280 2>/dev/null | grep -q '"documents"' \
|| quickwit index create --index-config /tmp/documents-index.yaml --node-uri http://quickwit:7280
/bin/sh -c "
echo 'Running database migrations' &&
diesel migration run &&
echo 'Ensuring tenant admin exists' &&
if papercrate-admin list-tenants | grep -q '^admin '; then
echo 'tenant admin already exists';
else
papercrate-admin create-tenant admin;
fi &&
echo 'Ensuring demo user credentials' &&
(papercrate-admin create-user admin adminadmin || papercrate-admin set-password admin adminadmin) &&
echo 'Ensuring demo membership' &&
papercrate-admin add-user-to-tenant admin admin admin &&
echo 'Ensuring Quickwit index for admin tenant' &&
papercrate-admin quickwit-create-index admin
"
user: root
restart: "no"
volumes: