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

View File

@ -1,29 +1,5 @@
#!/bin/bash
#!/bin/sh
set -e
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"
export PAYLOAD_SECRET=$(cat /run/secrets/payload_secret)
node dist/server.js