2020-06-18 16:12:07 +02:00
|
|
|
- name: app
|
|
|
|
type: 'python:3.8'
|
|
|
|
build:
|
|
|
|
flavor: none
|
|
|
|
relationships:
|
2021-06-16 18:04:51 +02:00
|
|
|
postgresdatabase: 'dbpostgres:postgresql'
|
|
|
|
cache: 'redis:redis'
|
2020-06-18 16:12:07 +02:00
|
|
|
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:
|
2021-06-16 18:04:51 +02:00
|
|
|
start: 'gunicorn posthog.wsgi --log-file -'
|
2020-06-18 16:12:07 +02:00
|
|
|
variables:
|
|
|
|
env:
|
|
|
|
DATABASE_URL: postgres://main:main@postgresdatabase.internal:5432/main
|
|
|
|
REDIS_URL: redis://cache.internal:6379
|
|
|
|
NODE_OPTIONS: --max_old_space_size=1536
|
2021-01-11 13:25:40 +01:00
|
|
|
DEPLOYMENT: Platform.sh
|
2020-06-18 16:12:07 +02:00
|
|
|
workers:
|
2021-06-16 18:04:51 +02:00
|
|
|
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
|