Skip to content

Commit

Permalink
Use single entrypoint for both images but detect which to run
Browse files Browse the repository at this point in the history
  • Loading branch information
frankh committed Nov 24, 2023
1 parent edd19ce commit c348efb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/docker-server
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ set -e

./bin/migrate-check

# if we are on the unit image run the unit entrypoint
if [ -f /usr/local/bin/docker-entrypoint.sh ]; then
echo "Running unit entrypoint"
exec $(dirname -- "${BASH_SOURCE[0]}")/docker-server-unit
fi

# To ensure we are able to expose metrics from multiple processes, we need to
# provide a directory for `prometheus_client` to store a shared registry.
export PROMETHEUS_MULTIPROC_DIR=$(mktemp -d)
trap 'rm -rf "$PROMETHEUS_MULTIPROC_DIR"' EXIT

export PROMETHEUS_METRICS_EXPORT_PORT=8001
export STATSD_PORT=${STATSD_PORT:-8125}
echo "Running gunicorn"

exec gunicorn posthog.wsgi \
--config gunicorn.config.py \
Expand Down

0 comments on commit c348efb

Please sign in to comment.