
postgrest/postgrestPostgREST是一款能够直接从现有PostgreSQL数据库生成完整RESTful API的工具。它无需手动编写API代码,即可提供比传统开发方式更简洁、符合标准规范且性能更优的API服务。
适用于需要快速为PostgreSQL数据库提供API接口的各类场景:
PostgREST镜像通过环境变量进行配置,所有可用配置参数详见PostgREST官方配置文档。
bashdocker run -d \ --name postgrest \ -e PGRST_DB_URI="postgres://username:password@postgres-host:5432/dbname" \ -e PGRST_SERVER_PORT=3000 \ -p 3000:3000 \ postgrest/postgrest
PGRST_DB_URI: PostgreSQL数据库连接URI,格式为postgres://user:password@host:port/dbnamePGRST_SERVER_PORT: 服务监听端口(默认3000)PGRST_DB_SCHEMA: 指定数据库模式(默认"public")PGRST_AUTH_JWT_SECRET: JWT认证密钥(如需启用认证)bashdocker run -d \ --name postgrest \ -e PGRST_DB_URI="postgres://admin:secret@postgres:5432/mydb" \ -e PGRST_SERVER_PORT=3000 \ -e PGRST_DB_SCHEMA="api" \ -e PGRST_AUTH_JWT_SECRET="myjwtsecret" \ -e PGRST_OPENAPI_SERVER_PROXY_URI="[***]" \ -p 3000:3000 \ --link postgres:postgres \ postgrest/postgrest
完整使用指南请查阅PostgREST Docker安装文档。
该镜像采用Nix工具从scratch构建,而非传统Dockerfile,确保生成高度安全且经过优化的镜像。因此镜像历史中不会显示构建命令。
注意:arm64架构变体基于Ubuntu构建,上述构建方式不适用于该架构版本。
构建过程详情及镜像检查方法,请参见PostgREST GitHub仓库。
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务