Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
utopia/docker-compose.yml at main · deeplethe/utopia · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
deeplethe
utopia
Repository navigation
Code
Issues
55
(55)
Pull requests
18
(18)
Discussions
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
utopia
/
docker-compose.yml
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
83 lines (81 loc) · 4.76 KB
main
Breadcrumbs
utopia
/
docker-compose.yml
Copy path
Top
File metadata and controls
Code
Blame
83 lines (81 loc) · 4.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
services
:
db
:
#
拉不动 Docker Hub 时可用 UTOPIA_DB_IMAGE 覆盖为任何带 pgvector 的 PG16+ 镜像
image
:
${UTOPIA_DB_IMAGE:-pgvector/pgvector:pg16}
environment
:
POSTGRES_USER
:
utopia
POSTGRES_PASSWORD
:
${UTOPIA_DB_PASSWORD:-utopia}
POSTGRES_DB
:
utopia
#
应用运行时用的受限角色口令。设了才建角色,不设则应用仍以 owner 身份跑。
#
#
**这一条故意保留 `${VAR:-}` 写法**,与下面 app 服务里那三条只写键名的
#
不同。区别不在风格,在于收它的人:那三条交给 Rust,空串会盖掉默认值;
#
这一条交给 `docker/init-app-role.sh`,它用 `[ -z ]` 判断,空串与未设
#
本来就是同一件事。改成只写键名不会坏,但也换不来什么,而写在这里
#
是为了让下一个想"顺手统一"的人先读到这段。
UTOPIA_APP_DB_PASSWORD
:
${UTOPIA_APP_DB_PASSWORD:-}
ports
:
#
宿主机侧避开 5432:开发机上常有本地装的 PG 占着那个端口,撞上就是
#
起不来。而且撞端口的人恰恰用不了自己那个 PG——它多半没有 pgvector。
#
容器内仍是 5432(PG 标准,app 走 compose 网络连的就是它)。
#
#
只绑回环:这个映射纯粹是给本地开发用的(cargo run 时从宿主机连),
#
绑 0.0.0.0 等于把一个默认口令的数据库挂到公网。
-
"
${UTOPIA_DB_BIND:-127.0.0.1:1517}:5432
"
volumes
:
-
dbdata:/var/lib/postgresql/data
#
首次初始化时建受限角色;数据目录已存在的部署不会执行,需手动建一次
#
(见 README 的升级说明)。权限由迁移 0031 授予,不在这里给。
-
./docker/init-app-role.sh:/docker-entrypoint-initdb.d/10-app-role.sh:ro
healthcheck
:
test
:
["CMD-SHELL", "pg_isready -U utopia -d utopia"]
interval
:
5s
timeout
:
3s
retries
:
10
#
完整部署:docker compose --profile app up -d
#
本地开发只起 db,应用用 cargo run 跑
#
#
这里只写 image 不写 build:两者并存时,本地没有镜像的 up 会去"构建"而不是
#
"拉取",预构建镜像就白发了。要从源码起,叠加 docker-compose.build.yml。
app
:
#
钉在已发布的具体版本。**这个默认值就是 README 承诺的那条命令**,
#
写一个不存在的标签,clone 下来第一步就是 manifest unknown。
#
所以撤掉一个版本时必须连它一起改——0.1.0 撤了,现在指向 rc。
#
转正之后改回 0.1.0(或改成 latest 让它自动跟随)。
image
:
${UTOPIA_IMAGE:-ghcr.io/deeplethe/utopia:0.1.0-rc9}
profiles
:
["app"]
environment
:
#
默认以 owner 身份运行。要启用受限角色(业务表随便读写、台账只增不改),
#
在 .env 里同时给出这两条——见 .env.example。分开写而不做条件拼接,
#
是因为那种嵌套替换没人读得懂,出错了也查不出来。
UTOPIA_DATABASE_URL
:
${UTOPIA_DATABASE_URL:-postgres://utopia:${UTOPIA_DB_PASSWORD:-utopia}@db:5432/utopia}
#
下面三条**只写键名不写值**:这样变量没设时容器里就没有这个变量,而
#
`${VAR:-}` 传进去的是空串。两者对应用不是一回事——空串会盖掉默认值,
#
而「盖掉默认值」正是 rc5 起不来的原因(#343):迁移连接串拿到空串,
#
sqlx 报 "relative URL without a base",照 README 的快速开始第一步就退出。
#
Rust 侧的 `blank_is_unset`(#344)已经补上,这里是同一件事的另一半:
#
空串根本不该发出去。设了值的情况照常——compose 会从宿主环境或 .env 取。
UTOPIA_MIGRATION_URL
:
UTOPIA_BIND_ADDR
:
0.0.0.0:1516
#
不设:首次启动自动生成一条存进 deployment_settings。这里若给缺省值,
#
自动生成就永远走不到,所有部署又会共用同一个人人皆知的密钥。
UTOPIA_JWT_SECRET
:
UTOPIA_SECRET_KEY
:
UTOPIA_WEB_DIST
:
/app/web-dist
UTOPIA_DATA_DIR
:
/app/data
#
连接池上限。缺省 32,与 worker 并发的缺省对齐;池子小于并发时症状是
#
请求变慢而不是报错说池子不够,所以调并发时别忘了它。
#
上调前先确认 Postgres 的 max_connections(默认 100)容得下。
UTOPIA_DB_MAX_CONNECTIONS
:
${UTOPIA_DB_MAX_CONNECTIONS:-32}
volumes
:
#
原始文件(files/)与全文索引(index/)。不挂出来的话,容器一重建
#
它们就没了,而库里的 documents 记录还在——引用全断且不报错。
#
备份 = 这个目录 + 数据库。
-
./data:/app/data
ports
:
-
"
1516:1516
"
depends_on
:
db
:
condition
:
service_healthy
volumes
:
dbdata
:
You can’t perform that action at this time.