-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprestart.sh
More file actions
34 lines (31 loc) · 908 Bytes
/
prestart.sh
File metadata and controls
34 lines (31 loc) · 908 Bytes
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
#! /usr/bin/env bash
echo "Running inside /app/prestart.sh, you could add migrations to this file, e.g.:"
# Get the URL for static files from the environment variable
USE_STATIC_URL=${STATIC_URL:-'/static'}
# Get the absolute path of the static files from the environment variable
USE_STATIC_PATH=${STATIC_PATH:-'/app/static'}
# Generate Nginx config first part using the environment variables
if [ ! -f "/etc/nginx/conf.d/custom.conf" ]; then
echo "server {
server_name $SERVER_NAME;
location / {
try_files \$uri @app;
}
location @app {
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;
}
location $USE_STATIC_URL {
alias $USE_STATIC_PATH;
}
}" > /etc/nginx/conf.d/custom.conf
fi
#echo "TEST TEST TEST"
#! /usr/bin/env bash
# Let the DB start
#cd alembic
#echo $PWD
#sleep 10;
# Run migrations
# alembic upgrade head
# TEST TEST TEST"