First commit for realz API REST service
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
services:
|
||||
api:
|
||||
image: postgrest/postgrest
|
||||
ports:
|
||||
- "3300:3000"
|
||||
environment:
|
||||
PGRST_DB_URI: postgres://${PGRST_AUTHUSER}:${PGRST_PASSWORD}@postgis:5432
|
||||
PGRST_DB_SCHEMAS: raf20lambert93
|
||||
PGRST_DB_ANON_ROLE: web_anon
|
||||
PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
|
||||
postgis:
|
||||
image: realz
|
||||
container_name: postgis_initialized
|
||||
@@ -6,6 +15,8 @@ services:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=${POSTGRES_DB} # Base de données pour l'administration, pas celle de l'app
|
||||
- PGRST_AUTHUSER=${PGRST_AUTHUSER}
|
||||
- PGRST_PASSWORD=${PGRST_PASSWORD}
|
||||
ports:
|
||||
- "5433:5432"
|
||||
volumes:
|
||||
|
@@ -11,5 +11,14 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
|
||||
EOSQL
|
||||
|
||||
echo "Init database data with RGF93"
|
||||
raster2pgsql -s RGF93 -I -C -M /opt/RAF20_lambert93.tiff -F -t 100x100 public.raf20lamber93 | psql -U ${POSTGRES_USER} -d ${POSTGRES_DB}
|
||||
raster2pgsql -s EPSG:2154 -I -C -M /opt/RAF20_lambert93.tiff -F -t 100x100 public.raf20lambert93 | psql -U ${POSTGRES_USER} -d ${POSTGRES_DB}
|
||||
exit $?
|
||||
|
||||
echo "Create postgrest roles"
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||
CREATE ROLE webanon nologin;
|
||||
GRANT USAGE ON SCHEMA raf20lamber93 TO webanon;
|
||||
GRANT SELECT ON SCHEMA raf20lamber93 TO webanon;
|
||||
GRANT web_anon to ${POSTGRES_USER}
|
||||
EOSQL
|
||||
|
Reference in New Issue
Block a user