forked from pyslackers/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.platform.app.yaml
59 lines (51 loc) · 1.66 KB
/
.platform.app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This file describes an application. You can have multiple applications
# in the same project.
#
# See https://docs.platform.sh/user_guide/reference/platform-app-yaml.html
# The name of this app. Must be unique within a project.
name: "website"
# The runtime the application uses.
type: "python:3.8"
# The size of the persistent disk of the application (in MB).
disk: 512 # MB
# The app configuration when it is exposed to the web.
web:
upstream:
socket_family: unix
commands:
start: "gunicorn --workers 1 --bind unix:$SOCKET --worker-class aiohttp.worker.GunicornUVLoopWebWorker pyslackersweb:app_factory"
locations:
"/":
passthru: true
allow: false
"/web/static":
root: "pyslackersweb/website/static"
expires: 1h
allow: true
# The hooks executed at various points in the lifecycle of the application.
hooks:
build: |
curl -sS https://platform.sh/cli/installer | php
pip install -r requirements/production.txt
deploy: |
alembic upgrade head
crons:
renewcert:
# Force a redeploy at 10 am (UTC) on the 1st and 15th of every month.
# A redeploy is required to renew the certificate. The redeploy will only
# do something when the certificates are almost expired.
spec: '0 10 1,15 * *'
cmd: |
if [ "$PLATFORM_BRANCH" = master ]; then
platform redeploy --yes --no-wait
fi
snapshot:
# Take a snapshot of master environment everyday a 3 am (UTC)
spec: '0 3 * * *'
cmd: |
if [ "$PLATFORM_BRANCH" = master ]; then
platform snapshot:create --yes --no-wait
fi
relationships:
applicationcache: "redisdata:redis"
database: "database:postgresql"