Skip to content

Commit

Permalink
refacto docker-compose + env var injection
Browse files Browse the repository at this point in the history
  • Loading branch information
thoomasbro committed Jun 11, 2024
1 parent 43d088f commit 3f855d8
Show file tree
Hide file tree
Showing 25 changed files with 615 additions and 587 deletions.
59 changes: 59 additions & 0 deletions .env.backend.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
BACKEND_HTTP_PORT=
ENVIRONMENT=
PROJECT_NAME=
MONITORENV_IMAGE=
MONITORENV_URL=
MONITORENV_VERSION=
MONITORENV_API_KEY=

# Spring
MONITORENV_FLYWAY_LOCATIONS=
ENV_DB_URL=

# Sentry
MONITORENV_SENTRY_ENABLED=
SENTRY_DSN=

# MonitorFish
MONITORFISH_URL=
MONITORFISH_API_KEY=

# RapportNav
RAPPORTNAV_URL=

# OICD
MONITORENV_OIDC_CLIENT_ID=
MONITORENV_OIDC_ENABLED=
MONITORENV_OIDC_ISSUER_URI=
MONITORENV_OIDC_USERINFO_ENDPOINT=


################################################################################
# Geoserver

# Database host from geoserver container
GEOSERVER_DB_HOST=
GEOSERVER_PORT=
GEOSERVER_ADMIN_USER=
GEOSERVER_ADMIN_PASSWORD=
# Host to access geoserver from within the server
GEOSERVER_HOST=

################################################################################
# PostgreSQL

POSTGRES_PORT=
POSTGRES_USER=
POSTGRES_DB=
POSTGRES_HOST=
POSTGRES_SCHEMA=
POSTGRES_PASSWORD=

MONITORENV_DATA_FOLDER=

################################################################################
# Monitoring & Backup

MONITORENV_LOGS_AND_BACKUPS_GID=
MONITORENV_LOGS_FOLDER=
MONITORENV_BACKUPS_FOLDER=
118 changes: 118 additions & 0 deletions .env.dev.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
PROJECT_NAME=monitorenv
ENVIRONMENT=dev
MONITORENV_URL=http://localhost:8880
BACKEND_HTTP_PORT=8880
MONITORENV_API_KEY=DUMMY-API-KEY

# Spring
MONITORENV_FLYWAY_LOCATIONS=classpath:/db/migration,classpath:/db/testdata
ENV_DB_URL=jdbc:postgresql://localhost:5432/monitorenvdb?user=postgres&password=postgres

# Sentry
MONITORENV_SENTRY_ENABLED=false
SENTRY_DSN=

# MonitorFish
MONITORFISH_URL=http://localhost:8082
MONITORFISH_API_KEY=changeme

# RapportNav
RAPPORTNAV_URL=http://localhost:8083

# OICD
MONITORENV_OIDC_CLIENT_ID=monitorenv
MONITORENV_OIDC_ENABLED=true
MONITORENV_OIDC_ISSUER_URI=http://localhost:8085/realms/monitor
MONITORENV_OIDC_USERINFO_ENDPOINT=/protocol/openid-connect/userinfo


################################################################################
# Geoserver

# Database host from geoserver container
GEOSERVER_DB_HOST=db
GEOSERVER_PORT=8081
GEOSERVER_ADMIN_USER=geoserveradmin
GEOSERVER_ADMIN_PASSWORD=changeme
# Host to access geoserver from within the server
GEOSERVER_HOST=localhost

################################################################################
# PostgreSQL

POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_DB=monitorenvdb
POSTGRES_HOST=localhost
POSTGRES_SCHEMA=public
POSTGRES_PASSWORD=postgres

MONITORENV_DATA_FOLDER=./datascience/src/pipeline/data

################################################################################
# Monitoring & Backup

MONITORENV_LOGS_AND_BACKUPS_GID=1001
MONITORENV_LOGS_FOLDER=./logs
MONITORENV_BACKUPS_FOLDER=./backups


##### FRONTEND #####
################################################################################
################################################################################
################################################################################
# GeoServer

FRONTEND_GEOSERVER_NAMESPACE=monitorenv
FRONTEND_GEOSERVER_REMOTE_URL=//localhost:8081
# Production:
# FRONTEND_GEOSERVER_REMOTE_URL=https://monitorenv.din.developpement-durable.gouv.fr

################################################################################
# Google Maps

FRONTEND_GOOGLEMAPS_API_KEY=NOT_SET

################################################################################
# Mapbox

FRONTEND_MAPBOX_KEY=

################################################################################
# Sentry

FRONTEND_SENTRY_ENV=dev
FRONTEND_SENTRY_DSN=
FRONTEND_SENTRY_TRACING_ORIGIN=localhost
# Staging
# FRONTEND_SENTRY_TRACING_ORIGIN=monitorenv-test.csam.e2.rie.gouv.fr
# Production
# FRONTEND_SENTRY_TRACING_ORIGIN=monitorenv.din.developpement-durable.gouv.fr

################################################################################
# Shom

FRONTEND_SHOM_KEY=

################################################################################
# Feature flags

FRONTEND_MISSION_FORM_AUTO_UPDATE=true
FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_UPDATE=true

################################################################################
# Version

FRONTEND_MONITORENV_VERSION=0.0.0

################################################################################
# OICD

FRONTEND_OIDC_AUTHORITY=http://localhost:8085/realms/monitor
FRONTEND_OIDC_CLIENT_ID=monitorenv
FRONTEND_OIDC_ENABLED=true
FRONTEND_OIDC_REDIRECT_URI=http://localhost:3000/login

################################################################################
22 changes: 22 additions & 0 deletions .env.integration.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ENVIRONMENT=integration
MONITORENV_URL=http://monitorenv-test.csam.e2.rie.gouv.fr
MONITORENV_API_KEY=DUMMY-API-KEY

# Spring
MONITORENV_FLYWAY_LOCATIONS=classpath:/db/migration,classpath:/db/testdata

# Sentry
MONITORENV_SENTRY_ENABLED=true
SENTRY_DSN=https://a5f3272efa794bb9ada2ffea90f2fec5@sentry.incubateur.net/8

# MonitorFish
MONITORFISH_URL=http://monitorfish-test.csam.e2.rie.gouv.fr
MONITORFISH_API_KEY=changeme

# RapportNav
RAPPORTNAV_URL==http://int-rapportnav-appli01.dsi.damgm.i2

# OICD
MONITORENV_OIDC_ENABLED=true
MONITORENV_OIDC_ISSUER_URI=https://authentification.recette.din.developpement-durable.gouv.fr/authSAML/oidc/monitorenv
MONITORENV_OIDC_USERINFO_ENDPOINT=https://authentification.recette.din.developpement-durable.gouv.fr/authSAML/oidc/monitorenv/userinfo
119 changes: 119 additions & 0 deletions .env.prod.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
BACKEND_HTTP_PORT=
ENVIRONMENT=prod
PROJECT_NAME=monitorenv
MONITORENV_IMAGE=ghcr.io/mtes-mct/monitorenv/monitorenv-app
MONITORENV_URL=https://monitorenv.din.developpement-durable.gouv.fr
MONITORENV_VERSION=
MONITORENV_API_KEY=DUMMY-API-KEY


# Spring
MONITORENV_FLYWAY_LOCATIONS=classpath:/db/migration
ENV_DB_URL=

# Sentry
MONITORENV_SENTRY_ENABLED=true
SENTRY_DSN=https://a5f3272efa794bb9ada2ffea90f2fec5@sentry.incubateur.net/8

# MonitorFish
MONITORFISH_URL=https://monitorfish.din.developpement-durable.gouv.fr
MONITORFISH_API_KEY=changeme

# RapportNav
RAPPORTNAV_URL=https://rapport-nav.din.developpement-durable.gouv.fr

# OICD
MONITORENV_OIDC_ENABLED=true
MONITORENV_OIDC_ISSUER_URI=https://authentification.din.developpement-durable.gouv.fr/authSAML/oidc/monitorenv
MONITORENV_OIDC_USERINFO_ENDPOINT=/api/user


################################################################################
# Geoserver

# Database host from geoserver container
GEOSERVER_DB_HOST=
GEOSERVER_PORT=
GEOSERVER_ADMIN_USER=
GEOSERVER_ADMIN_PASSWORD=
# Host to access geoserver from within the server
GEOSERVER_HOST=

################################################################################
# PostgreSQL

POSTGRES_PORT=
POSTGRES_USER=
POSTGRES_DB=
POSTGRES_HOST=
POSTGRES_SCHEMA=
POSTGRES_PASSWORD=


################################################################################
# Monitoring & Backup

MONITORENV_LOGS_AND_BACKUPS_GID=
MONITORENV_LOGS_FOLDER=
MONITORENV_BACKUPS_FOLDER=


##### FRONTEND #####
################################################################################
################################################################################
################################################################################
# GeoServer

FRONTEND_GEOSERVER_NAMESPACE=monitorenv
FRONTEND_GEOSERVER_REMOTE_URL=//localhost:8081
# Production:
# FRONTEND_GEOSERVER_REMOTE_URL=https://monitorenv.din.developpement-durable.gouv.fr

################################################################################
# Google Maps

FRONTEND_GOOGLEMAPS_API_KEY=

################################################################################
# Mapbox

FRONTEND_MAPBOX_KEY=

################################################################################
# Sentry

FRONTEND_SENTRY_ENV=
FRONTEND_SENTRY_DSN=
FRONTEND_SENTRY_TRACING_ORIGIN=
# Staging
# FRONTEND_SENTRY_TRACING_ORIGIN=monitorenv-test.csam.e2.rie.gouv.fr
# Production
# FRONTEND_SENTRY_TRACING_ORIGIN=monitorenv.din.developpement-durable.gouv.fr

################################################################################
# Shom

FRONTEND_SHOM_KEY=

################################################################################
# Feature flags

FRONTEND_MISSION_FORM_AUTO_UPDATE=true
FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_UPDATE=true

################################################################################
# Version

FRONTEND_MONITORENV_VERSION=0.0.0

################################################################################
# OICD

FRONTEND_OIDC_AUTHORITY=
FRONTEND_OIDC_CLIENT_ID=
FRONTEND_OIDC_ENABLED=
FRONTEND_OIDC_REDIRECT_URI=

################################################################################
22 changes: 22 additions & 0 deletions .env.test.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ENVIRONMENT=test
MONITORENV_URL=http://localhost:8880
MONITORENV_API_KEY=DUMMY-API-KEY

# Spring
MONITORENV_FLYWAY_LOCATIONS=classpath:/db/migration,classpath:/db/testdata

# Sentry
MONITORENV_SENTRY_ENABLED=false
SENTRY_DSN=

# MonitorFish
MONITORFISH_URL=http://localhost:8082
MONITORFISH_API_KEY=changeme

# RapportNav
RAPPORTNAV_URL=http://localhost:8083

# OICD
MONITORENV_OIDC_ENABLED=true
MONITORENV_OIDC_ISSUER_URI==http://localhost:8085/realms/monitor
MONITORENV_OIDC_USERINFO_ENDPOINT=/protocol/openid-connect/userinfo
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Env variables
.env
.env.local
github_token.txt

# Notebooks
Expand Down
Loading

0 comments on commit 3f855d8

Please sign in to comment.