forked from ExpressGateway/express-gateway
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-entrypoint.sh
44 lines (31 loc) · 1.21 KB
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
set -e
if [ ! -e /var/lib/eg/gateway.config.yml ]; then
echo >&2 "gateway.config.yml file not found in $PWD - copying now..."
cp /usr/src/app/lib/config/gateway.config.yml \
/var/lib/eg/gateway.config.yml
fi
if [ ! -e /var/lib/eg/models ]; then
mkdir /var/lib/eg/models
fi
if [ ! -e /var/lib/eg/system.config.yml ]; then
echo >&2 "system.config.yml file not found in $PWD - copying now..."
cp /usr/src/app/lib/config/system.config.yml \
/var/lib/eg/system.config.yml
fi
if [ ! -e /var/lib/eg/models/users.json ]; then
echo >&2 "users.json file not found in $PWD - copying now..."
cp /usr/src/app/lib/config/models/users.json \
/var/lib/eg/models/users.json
fi
if [ ! -e /var/lib/eg/models/applications.json ]; then
echo >&2 "applications.json file not found in $PWD - copying now..."
cp /usr/src/app/lib/config/models/applications.json \
/var/lib/eg/models/applications.json
fi
if [ ! -e /var/lib/eg/models/credentials.json ]; then
echo >&2 "credentials.json file not found in $PWD - copying now..."
cp /usr/src/app/lib/config/models/credentials.json \
/var/lib/eg/models/credentials.json
fi
exec "$@"