This repository was archived by the owner on Oct 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.platform.app.yaml
84 lines (74 loc) · 2.05 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: 'forem-platform'
type: 'ruby:3.0'
disk: 2048
relationships:
database: "database:postgresql"
dependencies:
nodejs:
yarn: "*"
n: "*"
"@honeybadger-io/js": "*"
variables:
env:
DATABASE_URL: "postgresql://main:[email protected]:5432"
DATABASE_NAME: "main"
REDIS_URL: redis://cache.internal:6379
BUNDLE_CACHE_ALL: '1'
BUNDLE_CLEAN: '1' # /!\ if you are working with Ruby<2.7 this does not work well
BUNDLE_DEPLOYMENT: '1'
BUNDLE_ERROR_ON_STDERR: '1'
BUNDLE_WITHOUT: 'development:test'
# DEFAULT_BUNDLER_VERSION: "2.2.26" # in case none is mentioned in Gemfile.lock
N_PREFIX: /app/.global
EXECJS_RUNTIME: 'Node'
NODE_ENV: 'production'
RACK_ENV: 'production'
RAILS_ENV: 'production'
RAILS_LOG_TO_STDOUT: '1'
RAILS_TMP: '/tmp'
HONEYBADGER_API_KEY: "" # fixme: use `platform variable:create` for secrets
HONEYBADGER_JS_API_KEY: ""
hooks:
build: |
set -e
n auto && hash -r
# we install the bundled bundler version and fallback to a default (in env vars above)
export BUNDLER_VERSION="$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" || $DEFAULT_BUNDLER_VERSION
echo "Install bundler $BUNDLER_VERSION"
gem install --no-document bundler -v $BUNDLER_VERSION
echo "Installing gems"
bundle install
# install packages? k
echo "install packages k"
yarn add ahoy.js
# precompile assets
echo "Precompiling assets"
# We dont need secret here https://github.com/rails/rails/issues/32947
SECRET_KEY_BASE=1 bundle exec rails assets:precompile
deploy: bundle exec rake forem:health_check_token
mounts:
"/log":
source: local
source_path: log
"/storage":
source: local
source_path: storage
"/tmp":
source: local
source_path: tmp
web:
upstream:
socket_family: tcp
protocol: http
commands:
start: "bundle exec puma -e production"
locations:
"/":
root: "public"
passthru: true
expires: 1h
allow: true
workers:
queue:
commands:
start: bundle exec sidekiq -t 25