hacking until works
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Aadil Ayub 2023-01-24 17:18:39 +05:00
parent 637089aa42
commit a016159bab
2 changed files with 9 additions and 28 deletions

View File

@ -6,6 +6,7 @@ services:
image: decentral1se/kios-admin:latest image: decentral1se/kios-admin:latest
networks: networks:
- proxy - proxy
- internal
volumes: volumes:
- app:/home/node/app - app:/home/node/app
- node_modules:/home/node/app/node_modules - node_modules:/home/node/app/node_modules
@ -14,10 +15,13 @@ services:
PORT: 3000 PORT: 3000
NODE_ENV: production NODE_ENV: production
PAYLOAD_SECRET_FILE: /run/secrets/payload_secret PAYLOAD_SECRET_FILE: /run/secrets/payload_secret
PAYLOAD_CONFIG_PATH: /home/node/dist/payload.config.js
configs: configs:
- source: app_entrypoint - source: app_entrypoint
target: /docker-entrypoint.sh target: /docker-entrypoint.sh
mode: 0555 mode: 0555
entrypoint: /docker-entrypoint.sh
command: node dist/server.js
secrets: secrets:
- payload_secret - payload_secret
deploy: deploy:
@ -33,12 +37,12 @@ services:
db: db:
image: mongo:6.0.3 image: mongo:6.0.3
networks:
- internal
command: command:
- "--storageEngine=wiredTiger" - "--storageEngine=wiredTiger"
volumes: volumes:
- data:/data/db - data:/data/db
logging:
driver: none
volumes: volumes:
app: app:
@ -46,6 +50,7 @@ volumes:
data: data:
networks: networks:
internal:
proxy: proxy:
external: true external: true

View File

@ -1,29 +1,5 @@
#!/bin/bash #!/bin/sh
set -e export PAYLOAD_SECRET=$(cat /run/secrets/payload_secret)
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "PAYLOAD_SECRET"
node dist/server.js node dist/server.js