forked from NitroRCr/nyaai
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
87 lines (80 loc) · 2.34 KB
/
Copy pathdocker-compose.example.yml
File metadata and controls
87 lines (80 loc) · 2.34 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
services:
db:
image: abcfy2/zhparser:18 # Postgres with chinese tokenizer for FTS
environment:
POSTGRES_PASSWORD: pass
POSTGRES_INITDB_ARGS: '--locale=C --encoding=UTF8'
command: postgres -c wal_level=logical
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
volumes:
- pgdata:/var/lib/postgresql
configs:
- source: init_db
target: /docker-entrypoint-initdb.d/init.sql
server:
image: krytro/nyaai-server:latest
# or build from source:
# build:
# context: .
# dockerfile: Dockerfile.server
environment:
SITE_NAME: 'Nya AI'
FRONT_URL: update-this
ADMIN_URL: update-this
BETTER_AUTH_SECRET: update-this
DATABASE_URL: postgres://postgres:pass@db:5432/app
S3_ACCESS_KEY_ID: update-this
S3_SECRET_ACCESS_KEY: update-this
S3_ENDPOINT: update-this
S3_REGION: update-this
S3_BUCKET: update-this
SEARXNG_URL: update-this
depends_on:
db:
condition: service_healthy
web:
image: krytro/nyaai-web:latest
# or build from source:
# build:
# context: .
# dockerfile: Dockerfile.web
ports:
- 8080:8080 # user frontend
- 8081:8081 # admin frontend
environment:
SERVER_URL: http://server:3000
ZERO_CACHE_URL: http://zero-cache:4848
zero-cache:
image: rocicorp/zero:0.26.1
environment:
ZERO_UPSTREAM_DB: postgres://postgres:pass@db:5432/app
ZERO_CVR_DB: postgres://postgres:pass@db:5432/zero
ZERO_CHANGE_DB: postgres://postgres:pass@db:5432/zero
ZERO_REPLICA_FILE: /data/zero.db
# Password used to access the inspector and /statz
ZERO_ADMIN_PASSWORD: pickanewpassword
ZERO_QUERY_URL: http://server:3000/api/zero/query
ZERO_MUTATE_URL: http://server:3000/api/zero/mutate
ZERO_QUERY_FORWARD_COOKIES: true
ZERO_MUTATE_FORWARD_COOKIES: true
volumes:
# Disk for the SQLite replica should be high IOPS
- zero-cache-data:/data
depends_on:
server:
condition: service_started
healthcheck:
test: curl -f http://localhost:4848/keepalive
interval: 5s
volumes:
pgdata:
zero-cache-data:
configs:
init_db:
content: |
CREATE DATABASE app;
CREATE DATABASE zero;
\c app;
CREATE EXTENSION IF NOT EXISTS zhparser;