Skip to content

Commit fb0e2a3

Browse files
committed
pyard-service Docker changes
- import pyard on start, not build - use a docker-entrypoint script to start the app - update Makefile to produce versioned docker image
1 parent 3fd5319 commit fb0e2a3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docker-entrypoint-flask.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# A positive integer generally in the 2-4 x $(NUM_CORES) range.
5+
WORKER_PROCESSES=${WORKERS:-4}
6+
7+
echo "Starting Magenta with" "${WORKER_PROCESSES}" worker processes.
8+
9+
if [ "${WORKER_PROCESSES}" != "1" ]; then
10+
WORKER_FLAG="--workers=${WORKER_PROCESSES}"
11+
fi
12+
13+
# Import pyard before starting the app
14+
pyard-import
15+
16+
gunicorn --preload --bind 0.0.0.0:8080 --timeout 5000 --log-level info "${WORKER_FLAG}" app:app

0 commit comments

Comments
 (0)