Skip to content

Commit

Permalink
Merge pull request #179 from samuelveigarangel/issue-178
Browse files Browse the repository at this point in the history
Adiciona arquivos de ambiente e modifica docker-compose para utilizá-los
  • Loading branch information
gitnnolabs authored Sep 17, 2024
2 parents 5762f6b + aab05c7 commit f3d2858
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 62 deletions.
47 changes: 47 additions & 0 deletions .envs/.production/.flask
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -------------- OPAC Application configuration --------------
# ------------------------------------------------------------
# Possible values: True or False
OPAC_DEBUG_MODE=False

# Possible values: WARNING, INFO, ERROR, CRITICAL AND DEBUG
OPAC_LOG_LEVEL=WARNING

# Possible values: True or False
OPAC_MINIFY_PAGE=False

# Name for MongoDB. Ex: opac
OPAC_MONGODB_NAME=opac

# Path to directory app. Ex: /app/data
OPAC_DATABASE_DIR=/app/data

# Value for key. Ex: nmN73pR6
OPAC_SECRET_KEY=

# Name for MongoDB host
OPAC_MONGODB_HOST=opac_mongo

# -------------------- Journal path -------------------
# ------------------------------------------------------------

# Journal pages source paths. Ex: /app/data/pages
OPAC_JOURNAL_PAGES_SOURCE_PATH=/app/data/pages

# Journal images source paths. Ex: /app/data/img
OPAC_JOURNAL_IMAGES_SOURCE_PATH=/app/data/img


# --------- SSM (Simple Storage Manager) settings ------------
# ------------------------------------------------------------

OPAC_SSM_SCHEME=http
OPAC_SSM_DOMAIN=minio
OPAC_SSM_PORT=9000

# ----------------- Filter settings ---------------------
# ------------------------------------------------------------

# (in minutes). Ex: 5
OPAC_FILTER_SECTION_ENABLE_FOR_MIN_STUDY_AREAS=5
# Possible values: True or False
OPAC_FILTER_SECTION_ENABLE=True
22 changes: 22 additions & 0 deletions .envs/.production/.metrics
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# ------------------------- Metrics --------------------------
# ------------------------------------------------------------

# Enable metrics usage
# Possible values: True or False
OPAC_USE_METRICS=
OPAC_METRICS_URL=

# Enable Dimensions usage
# Possible values: True or False
OPAC_USE_DIMENSIONS=
OPAC_DIMENSIONS_URL=

# Enable PlumX metrics
# Possible values: True or False
OPAC_USE_PLUMX=
OPAC_PLUMX_METRICS_URL=

# Enable Altmetric metrics
# Possible values: True or False
OPAC_USE_ALTMETRIC=
OPAC_ALTMETRIC_METRICS_URL=
3 changes: 3 additions & 0 deletions .envs/.production/.minio
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MinIO configuration
MINIO_ROOT_USER=
MINIO_ROOT_PASSWORD=
13 changes: 13 additions & 0 deletions .envs/.production/.monitoring-apm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# APM (Application Performance Monitoring) settings
# True or False
OPAC_APM_ENABLED=False

# Url for APM
OPAC_APM_SERVER_URL=

# Name for Service. Ex. Website
OPAC_APM_SERVICE_NAME=Website

# Type of enviroment. Ex: production or local
OPAC_APM_ENVIRONMENT=production
OPAC_APM_SECRET_TOKEN=
21 changes: 21 additions & 0 deletions .envs/.production/.redis
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# --------------------- Redis configuration ------------------
# ------------------------------------------------------------

# Redis host for cache. Ex: redis-cache
OPAC_RQ_REDIS_HOST=redis-cache

# Redis port for cache. Ex: 6379
OPAC_RQ_REDIS_PORT=6379

# --------------------- Cache configuration ------------------
# ------------------------------------------------------------

# True or False
OPAC_CACHE_ENABLED=True

# Cache timeout (in seconds). Ex: 3600
OPAC_CACHE_DEFAULT_TIMEOUT=3600

# Redis host for cache. Ex: redis-cache
OPAC_CACHE_REDIS_HOST=redis-cache

7 changes: 7 additions & 0 deletions .envs/.production/.server
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ----------------- Server Configuration ---------------------
# ------------------------------------------------------------

OPAC_SERVER_NAME=
# Possible values: True or False
OPAC_AUDIT_LOG_NOTIFICATION_ENABLED=
OPAC_AUDIT_LOG_NOTIFICATION_RECIPIENTS=
77 changes: 15 additions & 62 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,11 @@ services:
- redis-cache:redis-cache
expose:
- "8000"
environment:
- OPAC_DEBUG_MODE=False
- OPAC_LOG_LEVEL=WARNING
- OPAC_MINIFY_PAGE=False
- OPAC_MONGODB_NAME=opac
- OPAC_DATABASE_DIR=/app/data
- OPAC_SECRET_KEY=s3kr3tk3y
- OPAC_MONGODB_HOST=opac_mongo
- OPAC_CACHE_ENABLED=True
- OPAC_CACHE_DEFAULT_TIMEOUT=3600
- OPAC_CACHE_REDIS_HOST=redis-cache
- OPAC_USE_METRICS=True
- OPAC_METRICS_URL=http://analytics.scielo.org
- OPAC_USE_DIMENSIONS=True
- OPAC_DIMENSIONS_URL=https://badge.dimensions.ai/details/doi
- OPAC_USE_PLUMX=True
- OPAC_PLUMX_METRICS_URL=https://plu.mx/scielo/a
- OPAC_USE_ALTMETRIC=True
- OPAC_ALTMETRIC_METRICS_URL=https://www.altmetric.com/details.php
- OPAC_JOURNAL_PAGES_SOURCE_PATH=/app/data/pages
- OPAC_JOURNAL_IMAGES_SOURCE_PATH=/app/data/img
- OPAC_APM_ENABLED=False
- OPAC_APM_SERVER_URL=
- OPAC_APM_SERVICE_NAME=Website
- OPAC_APM_ENVIRONMENT=production
- OPAC_APM_SECRET_TOKEN=
- OPAC_SSM_SCHEME=http
- OPAC_SSM_DOMAIN=minio
- OPAC_SSM_PORT=9000
- OPAC_FILTER_SECTION_ENABLE_FOR_MIN_STUDY_AREAS=5
- OPAC_FILTER_SECTION_ENABLE=True
env_file:
- ./.envs/.production/.flask
- ./.envs/.production/.redis
- ./.envs/.production/.monitoring-apm
- ./.envs/.production/.metrics

nginx:
image: nginx:latest
Expand Down Expand Up @@ -98,20 +72,10 @@ services:
links:
- opac_mongo:opac-mongo
- redis-cache:redis-cache
environment:
- OPAC_DEBUG_MODE=False
- OPAC_MONGODB_NAME=opac
- OPAC_DATABASE_DIR=/app/data
- OPAC_SECRET_KEY=s3kr3tk3y
- OPAC_MONGODB_HOST=opac-mongo
- OPAC_CACHE_ENABLED=True
- OPAC_CACHE_DEFAULT_TIMEOUT=3600
- OPAC_CACHE_REDIS_HOST=redis-cache
- OPAC_SERVER_NAME=opac.scielo.org
- OPAC_AUDIT_LOG_NOTIFICATION_ENABLED=True
- [email protected],[email protected]
- OPAC_RQ_REDIS_HOST=redis-cache
- OPAC_RQ_REDIS_PORT=6379
env_file:
- ./.envs/.production/.flask
- ./.envs/.production/.redis
- ./.envs/.production/.server

opac-rq-scheduler:
image: infrascielo/opac_5
Expand All @@ -128,20 +92,10 @@ services:
links:
- opac_mongo:opac-mongo
- redis-cache:redis-cache
environment:
- OPAC_DEBUG_MODE=False
- OPAC_MONGODB_NAME=opac
- OPAC_DATABASE_DIR=/app/data
- OPAC_SECRET_KEY=s3kr3tk3y
- OPAC_MONGODB_HOST=opac-mongo
- OPAC_CACHE_ENABLED=True
- OPAC_CACHE_DEFAULT_TIMEOUT=3600
- OPAC_CACHE_REDIS_HOST=redis-cache
- OPAC_SERVER_NAME=opac.scielo.org
- OPAC_AUDIT_LOG_NOTIFICATION_ENABLED=True
- [email protected],[email protected]
- OPAC_RQ_REDIS_HOST=redis-cache
- OPAC_RQ_REDIS_PORT=6379
env_file:
- ./.envs/.production/.flask
- ./.envs/.production/.redis
- ./.envs/.production/.server

minio:
image: 'minio/minio:RELEASE.2024-06-29T01-20-47Z'
Expand All @@ -150,9 +104,8 @@ services:
ports:
- '9000:9000'
- '9001:9001'
environment:
- MINIO_ROOT_USER=
- MINIO_ROOT_PASSWORD=
env_file:
- ./.envs/.production/.minio
volumes:
- '../minio/data:/data'
command: server --console-address ":9001" /data

0 comments on commit f3d2858

Please sign in to comment.