0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-28 09:16:49 +01:00
posthog/.platform/applications.yaml
Ori Pekelman 0004e2ef9d
One click deploy for platform.sh (#1044)
* platformize

* Deploy to platform button

* platformize

* correct celery command

* use project entropy so we are production ready

* This can be a diskless app

* prettier on a single line

* add README.md

* revert change to main README.md

* move secret to .environment
2020-06-18 16:12:07 +02:00

37 lines
1.3 KiB
YAML

- 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
workers:
worker:
commands:
start: celery -A posthog worker --beat --scheduler redbeat.RedBeatScheduler --loglevel=info --pidfile="/tmp/celerybeat.pid" --concurrency=2