-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
183 docker compose optimizazione #188
base: master
Are you sure you want to change the base?
Changes from all commits
197224c
a984d52
7d0eebe
6914dbb
9fea892
4666dd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
name: iam-proxy-italia | ||
services: | ||
|
||
satosa-mongo: | ||
mongo: | ||
profiles: | ||
- demo | ||
- mongo | ||
- mongoexpress | ||
image: mongo | ||
container_name: satosa-mongo | ||
environment: | ||
MONGO_INITDB_DATABASE: oidcop | ||
MONGO_INITDB_ROOT_USERNAME: "${MONGO_DBUSER:-satosa}" | ||
|
@@ -18,66 +17,50 @@ services: | |
# - mongodata:/data/db # to be used for external volumes | ||
ports: | ||
- '27017-27019:27017-27019' | ||
networks: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as per my previous comment |
||
- iam-proxy-italia | ||
|
||
satosa-mongo-express: | ||
express: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as per my previous comment |
||
profiles: | ||
- demo | ||
- mongoexpress | ||
image: mongo-express | ||
container_name: satosa-mongo-express | ||
ports: | ||
- 8082:8081 | ||
depends_on: | ||
- satosa-mongo | ||
- mongo | ||
environment: | ||
ME_CONFIG_BASICAUTH_USERNAME: "${EXPRESS_USER:-satosauser}" | ||
ME_CONFIG_BASICAUTH_PASSWORD: "${EXPRESS_PASSWORD:-satosapw}" | ||
ME_CONFIG_MONGODB_ADMINUSERNAME: "${MONGO_DBUSER:-satosa}" | ||
ME_CONFIG_MONGODB_ADMINPASSWORD: "${MONGO_DBPASSWORD:-thatpassword}" | ||
ME_CONFIG_MONGODB_URL: mongodb://${MONGO_DBUSER:-satosa}:${MONGO_DBPASSWORD:-thatpassword}@satosa-mongo:27017/ | ||
TZ: "${TZ:-Europe/Rome}" | ||
networks: | ||
- iam-proxy-italia | ||
|
||
django_sp: | ||
sp: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a django sp, therefore its name is django sp There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we haven't other SP, why distinguish them? |
||
profiles: | ||
- demo | ||
- dev | ||
build: | ||
context: ../ | ||
args: | ||
- NODE_ENV=local | ||
dockerfile: example_sp/django.Dockerfile | ||
container_name: django_sp | ||
context: ../ | ||
dockerfile: example_sp/django.Dockerfile | ||
working_dir: /django_sp | ||
entrypoint: "sh ../entrypoint.sh" | ||
volumes: | ||
- ./djangosaml2_sp:/django_sp:rw | ||
ports: | ||
- "8000:8000" | ||
networks: | ||
- iam-proxy-italia | ||
|
||
iam-proxy-italia: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iam-proxy-italia is the container name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iam-proxy-italia is the project name. Whe should call the service with a functional name for his work. |
||
satosa: | ||
image: ghcr.io/italia/iam-proxy-italia:latest | ||
# image: iam-proxy-italia:latest | ||
# build: | ||
# context: ../ | ||
# args: | ||
# - NODE_ENV=local | ||
# dockerfile: Dockerfile | ||
container_name: iam-proxy-italia | ||
# depends_on: | ||
# - satosa-mongo | ||
build: | ||
context: ../ | ||
dockerfile: Dockerfile | ||
stdin_open: ${SATOSA_DEBUG:-false} # enables PDB when attach to the compose | ||
tty: ${SATOSA_DEBUG:-false} # enables PDB when attach to the compose | ||
environment: | ||
- TZ=${TZ:-Europe/Rome} | ||
- SATOSA_DEBUG=${SATOSA_DEBUG:-false} | ||
- SATOSA_BY_DOCKER=1 | ||
- GET_IDEM_MDQ_KEY=${GET_IDEM_MDQ_KEY:-true} | ||
- GET_METADATA_AND_KEY=${GET_IDEM_MDQ_KEY:-true} | ||
|
||
- BASE_DIR=/satosa_proxy | ||
- SATOSA_PRIVATE_KEY=${SATOSA_KEYS_FOLDER:-./pki}/${SATOSA_PRIVATE_KEY_FILENAME:-privkey.pem} | ||
|
@@ -125,31 +108,24 @@ services: | |
- ./satosa-project:/satosa_proxy:rwx | ||
# - ./eudi-wallet-it-python/pyeudiw:/.venv/lib/python3.12/site-packages/pyeudiw:rwx | ||
# - iam-proxy-italia-data:/satosa_proxy # to be used for external volumes | ||
working_dir: /satosa_proxy | ||
entrypoint: "sh entrypoint.sh" | ||
networks: | ||
- iam-proxy-italia | ||
healthcheck: | ||
test: wget -O - https://satosa-nginx/Saml2IDP/metadata --no-check-certificate || exit 1 | ||
test: wget -O - https://nginx/Saml2IDP/metadata --no-check-certificate || exit 1 | ||
interval: 30s | ||
retries: 10 | ||
start_period: 30s | ||
timeout: 30s | ||
|
||
satosa-nginx: | ||
nginx: | ||
image: nginx:alpine | ||
container_name: satosa-nginx | ||
depends_on: | ||
- iam-proxy-italia | ||
- satosa | ||
ports: | ||
- "443:443" | ||
volumes: | ||
- ./nginx/conf.d:/etc/nginx/conf.d:ro | ||
- ./nginx/html:/usr/share/nginx/html:ro | ||
- ./nginx/certs:/etc/nginx/certs:ro | ||
# - static:/usr/share/nginx/html # to be used for external volumes | ||
networks: | ||
- iam-proxy-italia | ||
environment: | ||
- NGINX_HOST=${SATOSA_HOSTNAME:-localhost} | ||
- TZ=${TZ:-Europe/Rome} | ||
|
@@ -159,14 +135,8 @@ services: | |
- demo | ||
- dev | ||
image: italia/spid-saml-check | ||
container_name: spid-samlcheck | ||
ports: | ||
- "8443:8443" | ||
networks: | ||
- iam-proxy-italia | ||
networks: | ||
iam-proxy-italia: | ||
name: iam-proxy-italia | ||
|
||
## External volumes | ||
# volumes: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,4 @@ RUN poetry install | |
RUN poetry add setuptools | ||
|
||
WORKDIR $BASEDIR/ | ||
ENTRYPOINT ["sh", "entrypoint.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,27 +21,27 @@ USER_ID_HASH_SALT: !ENV SATOSA_SALT | |
ERROR_URL: !ENV SATOSA_UNKNOW_ERROR_REDIRECT_PAGE | ||
|
||
CUSTOM_PLUGIN_MODULE_PATHS: | ||
#- "plugins/ping" | ||
- "plugins/backends" | ||
- "plugins/frontends" | ||
- "plugins/micro_services" | ||
#- "configuration/ping" | ||
- "configuration/backends" | ||
- "configuration/frontends" | ||
- "configuration/micro_services" | ||
BACKEND_MODULES: | ||
- "plugins/backends/saml2_backend.yaml" | ||
- "plugins/backends/spidsaml2_backend.yaml" | ||
- "plugins/backends/ciesaml2_backend.yaml" | ||
- "plugins/backends/pyeudiw_backend.yaml" | ||
- "configuration/backends/saml2_backend.yaml" | ||
- "configuration/backends/spidsaml2_backend.yaml" | ||
- "configuration/backends/ciesaml2_backend.yaml" | ||
# - "configuration/backends/pyeudiw_backend.yaml" | ||
FRONTEND_MODULES: | ||
- "plugins/frontends/saml2_frontend.yaml" | ||
# - "plugins/frontends/oidcop_frontend.yaml" | ||
- "configuration/frontends/saml2_frontend.yaml" | ||
# - "configuration/frontends/oidcop_frontend.yaml" | ||
MICRO_SERVICES: | ||
# - "plugins/microservices/spid_unical_account_linking.yaml" | ||
# - "plugins/microservices/multiple_ldap_attribute_store.yaml" | ||
# - "plugins/microservices/ldap_attribute_store.yaml" | ||
# - "configuration/microservices/spid_unical_account_linking.yaml" | ||
# - "configuration/microservices/multiple_ldap_attribute_store.yaml" | ||
# - "configuration/microservices/ldap_attribute_store.yaml" | ||
# re-process again after new attributes beign pushed (or not) from ldap store | ||
# - "plugins/microservices/spid_unical_account_linking.yaml" | ||
- "plugins/microservices/idp_hinting.yaml" | ||
- "plugins/microservices/disco_to_target_issuer.yaml" | ||
- "plugins/microservices/target_based_routing.yaml" | ||
# - "configuration/microservices/spid_unical_account_linking.yaml" | ||
- "configuration/microservices/idp_hinting.yaml" | ||
- "configuration/microservices/disco_to_target_issuer.yaml" | ||
- "configuration/microservices/target_based_routing.yaml" | ||
LOGGING: | ||
version: 1 | ||
formatters: | ||
|
@@ -50,14 +50,6 @@ LOGGING: | |
syslog: | ||
format: "[SATOSA] [%(name)s] [%(levelname)s]: %(message)s" | ||
handlers: | ||
spid_daily: | ||
class: logging.handlers.TimedRotatingFileHandler | ||
level: INFO | ||
formatter: simple | ||
filename: logs/spid.log | ||
when: D | ||
interval: 1 | ||
backupCount: 860 | ||
syslog: | ||
class: logging.handlers.SysLogHandler | ||
level: INFO | ||
|
@@ -67,22 +59,30 @@ LOGGING: | |
level: DEBUG | ||
formatter: simple | ||
stream: ext://sys.stdout | ||
saml2_debug_file: | ||
class: logging.handlers.RotatingFileHandler | ||
level: DEBUG | ||
formatter: simple | ||
filename: logs/saml2_debug.log | ||
maxBytes: 104857600 # 100MB | ||
backupCount: 20 | ||
encoding: utf8 | ||
oidcop_debug_file: | ||
class: logging.handlers.RotatingFileHandler | ||
level: DEBUG | ||
formatter: simple | ||
filename: logs/oidcop_debug.log | ||
maxBytes: 104857600 # 100MB | ||
backupCount: 20 | ||
encoding: utf8 | ||
# spid_daily: | ||
# class: logging.handlers.TimedRotatingFileHandler | ||
# level: INFO | ||
# formatter: simple | ||
# filename: logs/spid.log | ||
# when: D | ||
# interval: 1 | ||
# backupCount: 860 | ||
Comment on lines
+62
to
+69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? let's keep cie and spid policy retention configured by default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In docker spid daily is not used, the log are sended to docker logs from STDOUT. Spid daily handler is used only for local installation and must be configured manually in proxy_conf.yaml. If someone want use this must uncommented this and change the handler loggers from |
||
# saml2_debug_file: | ||
# class: logging.handlers.RotatingFileHandler | ||
# level: DEBUG | ||
# formatter: simple | ||
# filename: logs/saml2_debug.log | ||
# maxBytes: 104857600 # 100MB | ||
# backupCount: 20 | ||
# encoding: utf8 | ||
# oidcop_debug_file: | ||
# class: logging.handlers.RotatingFileHandler | ||
# level: DEBUG | ||
# formatter: simple | ||
# filename: logs/oidcop_debug.log | ||
# maxBytes: 104857600 # 100MB | ||
# backupCount: 20 | ||
# encoding: utf8 | ||
loggers: | ||
satosa: | ||
level: INFO | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there might be different containers about mongo, and this is the mongo within the satosa network with a specialized name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The container name is composed by project name +service name + istance number = iam-proxy-italia-mongo-1
The image name is composed by project name +service name = iam-proxy-italia-mongo
But you can call it with the service name in composer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project name is defined in first docker-compose line with key
name: iam-proxy-italia