0
1
Fork 0

compose fixes

This commit is contained in:
Juan Ferrer 2022-05-08 23:54:48 +02:00
parent 7464abc5a4
commit 4f82cc9e9a
2 changed files with 7 additions and 6 deletions

6
Jenkinsfile vendored
View File

@ -16,11 +16,13 @@ pipeline {
switch (env.BRANCH_NAME) { switch (env.BRANCH_NAME) {
case 'master': case 'master':
env.NODE_ENV = 'production' env.NODE_ENV = 'production'
env.REPLICAS = 3 env.MAIN_REPLICAS = 3
env.CRON_REPLICAS = 1
break break
case 'test': case 'test':
env.NODE_ENV = 'test' env.NODE_ENV = 'test'
env.REPLICAS = 1 env.MAIN_REPLICAS = 1
env.CRON_REPLICAS = 0
break break
} }
} }

View File

@ -17,13 +17,13 @@ services:
- /mnt/appdata/image:/var/lib/hedera-web/image-db - /mnt/appdata/image:/var/lib/hedera-web/image-db
- /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access - /mnt/appdata/vn-access:/var/lib/hedera-web/vn-access
deploy: deploy:
replicas: ${REPLICAS:?} replicas: ${MAIN_REPLICAS:?}
placement: placement:
constraints: constraints:
- node.role == worker - node.role == worker
cron: cron:
image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?} image: registry.verdnatura.es/hedera-web:${BRANCH_NAME:?}
command: '[[ $NODE_ENV == "production" ]] && cron -f' command: 'cron -f'
configs: configs:
- source: config - source: config
target: /etc/hedera-web/config.my.php target: /etc/hedera-web/config.my.php
@ -31,8 +31,7 @@ services:
- /mnt/appdata:/mnt/storage - /mnt/appdata:/mnt/storage
- /mnt/appdata/image:/var/lib/hedera-web/image-db - /mnt/appdata/image:/var/lib/hedera-web/image-db
deploy: deploy:
restart_policy: replicas: ${CRON_REPLICAS:?}
condition: none
placement: placement:
constraints: constraints:
- node.role == worker - node.role == worker