-
Notifications
You must be signed in to change notification settings - Fork 8
/
entrypoint.sh
21 lines (21 loc) · 713 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
if [[ -z $PEEWEE_DATABASE_URL ]] ; then
if [[ $PEEWEE_USER && $PEEWEE_PASS ]]; then
PEEWEE_USER_PART="${PEEWEE_USER}:${PEEWEE_PASS}@"
fi
if [[ $PEEWEE_PORT ]] ; then
PEEWEE_ADDR_PART="${PEEWEE_ADDR}:${PEEWEE_PORT}"
else
PEEWEE_ADDR_PART=$PEEWEE_ADDR
fi
PEEWEE_DATABASE_URL="${PEEWEE_PROTO}://${PEEWEE_USER_PART}${PEEWEE_ADDR_PART}/${PEEWEE_DATABASE}"
fi
mkdir ~/.pacifica-metadata/
cp /usr/src/app/server.conf ~/.pacifica-metadata/cpconfig.ini
printf '[database]\npeewee_url = '${PEEWEE_DATABASE_URL}'\n' > ~/.pacifica-metadata/config.ini
pacifica-metadata-cmd dbsync
uwsgi \
--http-socket 0.0.0.0:8121 \
--master \
--die-on-term \
--module pacifica.metadata.wsgi "$@"