Last active
February 19, 2025 15:51
-
-
Save austin2035/d999e1a7d33f5d8f915cf787276b3dbe to your computer and use it in GitHub Desktop.
postgresql-postgrest-docker.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
server: | |
image: postgrest/postgrest | |
ports: | |
- "8002:8002" | |
environment: | |
# 使用 postgres 超级用户 | |
PGRST_DB_URI: postgres://postgres:your_password@db:5432/app_db | |
PGRST_DB_SCHEMA: public | |
PGRST_DB_ANON_ROLE: postgres # 使用超级用户作为匿名角色 | |
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:8002 | |
# 允许所有跨域请求 | |
PGRST_SERVER_PORT: 8002 | |
PGRST_SERVER_CORS_ALLOWED_ORIGINS: "" | |
PGRST_DB_POOL: 50 | |
depends_on: | |
- db | |
db: | |
image: postgres:17.2 | |
restart: always | |
shm_size: 128mb | |
environment: | |
POSTGRES_DB: app_db | |
POSTGRES_USER: postgres # 使用默认的 postgres 超级用户 | |
POSTGRES_PASSWORD: your_password | |
ports: | |
- "5432:5432" | |
volumes: | |
- pgdata:/var/lib/postgresql/data | |
adminer: | |
image: adminer | |
restart: always | |
ports: | |
- 8001:8080 | |
volumes: | |
pgdata: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment