0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 02:49:32 +01:00
posthog/.platform/applications.yaml

38 lines
1.4 KiB
YAML
Raw Normal View History

- name: app
type: 'python:3.8'
build:
flavor: none
relationships:
postgresdatabase: "dbpostgres:postgresql"
cache: "redis:redis"
hooks:
build: |
# Install NVM and a recet version of node
unset NPM_CONFIG_PREFIX
NVM_VERSION="v0.35.3"
curl -o- https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | dash
NVM_DIR="$PLATFORM_APP_DIR/.nvm"
mkdir -p $PLATFORM_CACHE_DIR/.nvm
mkdir -p $NVM_DIR/.cache
ln -s $PLATFORM_CACHE_DIR/.nvm $NVM_DIR/.cache
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install stable
pip install -r requirements.txt
npm install -g yarn
yarn install
yarn build
python manage.py collectstatic --noinput
deploy: python manage.py migrate
web:
commands:
start: "gunicorn posthog.wsgi --log-file -"
variables:
env:
DATABASE_URL: postgres://main:main@postgresdatabase.internal:5432/main
REDIS_URL: redis://cache.internal:6379
NODE_OPTIONS: --max_old_space_size=1536
DEPLOYMENT: Platform.sh
workers:
worker:
commands:
start: celery -A posthog worker --beat --scheduler redbeat.RedBeatScheduler --loglevel=info --pidfile="/tmp/celerybeat.pid" --concurrency=2 --without-heartbeat --without-gossip --without-mingle