postgrest

This commit is contained in:
2025-10-13 07:49:20 +02:00
parent 3ac174ed2b
commit 87564a61a4
4 changed files with 31404 additions and 14 deletions

View File

@@ -3,8 +3,7 @@ services:
image: iut/pgsql:2025-12 image: iut/pgsql:2025-12
environment: environment:
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=fr-FR" POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=fr-FR"
POSTGRES_DB: ${COMPOSE_PROJECT_NAME} POSTGRES_PASSWORD: ${PG_PASSWORD:-!ChangeMe!}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${COMPOSE_PROJECT_NAME} POSTGRES_USER: ${COMPOSE_PROJECT_NAME}
volumes: volumes:
- database_data:/var/lib/postgresql:rw - database_data:/var/lib/postgresql:rw
@@ -165,7 +164,6 @@ services:
neo4j: neo4j:
image: neo4j:5.26.12-community image: neo4j:5.26.12-community
ports: ports:
- 7473:7473
- 7474:7474 - 7474:7474
- 7687:7687 - 7687:7687
volumes: volumes:
@@ -174,6 +172,40 @@ services:
environment: environment:
NEO4J_AUTH: neo4j/${DB_ROOT_PASSWORD:-!ChangeMe!} NEO4J_AUTH: neo4j/${DB_ROOT_PASSWORD:-!ChangeMe!}
# PostGraphile
# Instant GraphQL API
# https://www.graphile.org/postgraphile/
postgraphile:
build:
context: ./postgraphile
restart: "no"
depends_on:
database:
condition: service_healthy
command:
[
"--port", "${POSTGRAPHILE_PORT:-5000}",
"--schema", "${POSTGRAPHILE_SCHEMA:-public}",
"--enhance-graphiql",
"--cors",
"--allow-explain",
"--dynamic-json",
"--append-plugins",
"postgraphile-plugin-connection-filter,postgraphile-plugin-fulltext-filter,@graphile/postgis,postgraphile-plugin-connection-filter-postgis"
]
ports:
- 3006:5000
environment:
- PGHOST=${POSTGRAPHILE_HOST:-postgresql}
- PGPORT=${POSTGRAPHILE_DB_PORT:-5432}
- PGUSER=${POSTGRAPHILE_DB_USER:-postgraphile}
- PGPASSWORD=${DB_PASSWORD}
- PGDATABASE=${COMPOSE_PROJECT_NAME}
profiles:
- api
- graph
# Caddy # Caddy
# Web server, load balancer, and reverse proxy # Web server, load balancer, and reverse proxy
# https://caddyserver.com/ # https://caddyserver.com/
@@ -181,7 +213,7 @@ services:
image: caddy:2.10.2 image: caddy:2.10.2
restart: "no" restart: "no"
ports: ports:
- "8080:80" - "8019:80"
- "2019:2019" - "2019:2019"
volumes: volumes:
- ./data:/usr/share/caddy - ./data:/usr/share/caddy
@@ -197,7 +229,7 @@ services:
# https://docs.postgrest.org/en/v12/ # https://docs.postgrest.org/en/v12/
postgrest: postgrest:
image: postgrest/postgrest:${POSTGREST_VERSION:-v13.0.7} image: postgrest/postgrest:v13.0.7
restart: "no" restart: "no"
depends_on: depends_on:
database: database:
@@ -206,7 +238,7 @@ services:
ports: ports:
- 3005:3005 - 3005:3005
environment: environment:
PGRST_DB_URI: postgres://${POSTGREST_USER:-postgrest}:${DB_PASSWORD}@${POSTGREST_HOST:-postgresql}:${POSTGREST_DB_PORT:-5432}/${DB_NAME:-postgrest} PGRST_DB_URI: postgres://${POSTGREST_USER:-postgrest}:${DB_PASSWORD}@${POSTGREST_HOST:-database}:${POSTGREST_DB_PORT:-5432}/${COMPOSE_PROJECT_NAME}
PGRST_DB_SCHEMAS: ${POSTGREST_DB_SCHEMAS:-public} PGRST_DB_SCHEMAS: ${POSTGREST_DB_SCHEMAS:-public}
PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-role_web} PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-role_web}
PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET:-ABCDEFGHIJKLMNOPQRSTUVWXYZ} PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET:-ABCDEFGHIJKLMNOPQRSTUVWXYZ}
@@ -218,6 +250,22 @@ services:
profiles: profiles:
- api - api
scalar:
image: scalarapi/api-reference:0.4.2
ports:
- "8080:8080"
restart: "no"
environment:
API_REFERENCE_CONFIG: |
{
"sources":[
{"url": "https://registry.scalar.com/@scalar/apis/galaxy/latest?format=json"}
],
"theme": "purple"
}
profiles:
- api
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Observabilité - Télémétrie # Observabilité - Télémétrie
# #
@@ -245,16 +293,16 @@ services:
- grafana:/var/lib/grafana - grafana:/var/lib/grafana
ports: ports:
- 3000:3000 - 3000:3000
#environment: environment:
#GF_SECURITY_ADMIN_EMAIL: ${ADMIN_EMAIL} #GF_SECURITY_ADMIN_EMAIL: ${ADMIN_EMAIL}
#GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD} #GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
#GF_AUTH_ANONYMOUS_ENABLED: true # Enabled the Anonymous user no user/pass needed GF_AUTH_ANONYMOUS_ENABLED: true # Enabled the Anonymous user no user/pass needed
#GF_AUTH_ANONYMOUS_ORG_ROLE: Admin GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
#GF_AUTH_DISABLE_LOGIN_FORM: true GF_AUTH_DISABLE_LOGIN_FORM: true
#GF_USERS_DEFAULT_THEME: light GF_USERS_DEFAULT_THEME: light
#GF_USERS_ALLOW_SIGN_UP: false GF_USERS_ALLOW_SIGN_UP: false
#GF_FEATURE_TOGGLES_ENABLE: traceQLStreaming metricsSummary lokiFormatQuery alertmanagerRemoteOnly GF_FEATURE_TOGGLES_ENABLE: traceQLStreaming metricsSummary lokiFormatQuery alertmanagerRemoteOnly
#GF_INSTALL_PLUGINS: yesoreyeram-infinity-datasource GF_INSTALL_PLUGINS: yesoreyeram-infinity-datasource
profiles: profiles:
- telemetry - telemetry
@@ -278,6 +326,7 @@ services:
- telemetry - telemetry
volumes: volumes:
pgadmin:
database_data: database_data:
superset_home: superset_home:
couchdb_data: couchdb_data:

31323
data/commandes/commandes.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
create role postgrest noinherit login password 'motdepasse';
grant role_web to postgrest;
-- Postgraphile
create role postgraphile inherit login password 'motdepasse';
grant role_web to postgraphile;

12
postgraphile/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM node:alpine
LABEL description="Instant high-performance GraphQL API for your PostgreSQL database https://github.com/graphile/postgraphile"
# Install PostGraphile and PostGraphile connection filter plugin
RUN npm install -g postgraphile &&\
npm install -g postgraphile-plugin-connection-filter &&\
npm install -g @graphile/postgis &&\
npm install -g postgraphile-plugin-connection-filter-postgis &&\
npm install -g postgraphile-plugin-fulltext-filter
EXPOSE 5000
ENTRYPOINT ["postgraphile", "-n", "0.0.0.0", "--cors"]