-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.airstack.yml
133 lines (112 loc) · 3.66 KB
/
.airstack.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
!!!!!!!!!!!!!!!!!!!!
This file is an OLD WIP.
See airstack/core/airstack.yml for a working version.
!!!!!!!!!!!!!!!!!!!!
# Example .airstack.yml file
#
# Typically, the .airstack.yml file will reside in an app's root dir and be committed to git.
# The config values below define the app cluster.
#
# An app cluster consists of:
# - meta data about the app
# - what base container to use for the app
# - services to run in the app container; usually provided by the base container
# - env vars to set in the app container
# - components that make up the cluster: databases, workers, other services, etc.
#
# An app may optionally have a build file (Dockerfile or similar) that handles more
# advanced container requirements not already provided by the base container. An example
# is building a database container that requires downloading and compiling a tarball
# and setting up special user permissions.
#
name: airstack/blog
version: latest
# Number of app containers to start
instances: 1
environment: development
# example tag: 0.10.31~development~0.1~e123123
# primary version ~ environment ~ build hash
airstack/nodejs: development
# Container definition
container:
from:
image: airstack/nodejs
version: ^0.10
# Optional build file and build file encoding
# build: ./defaults/Dockerfile
# encoding: utf8
# Directories to bind mount into the container.
# Will be mounted in the base container user's home dir and
# symlinked into /home/airstack. This allows the airstack user to ssh
# into the container and see all the relevant mounts and data.
mount:
- ./
- ./defaults
- ./config:/package/airstack/cli/config
scripts:
# Automatically run start scripts on `air up`
start:
before: echo 'before'
cmd: npm start
# OR
# start: npm start
# Run on `air down`
stop: ./stop.sh
# Use namespaces to set environment specific scripts.
# CLI will use namespace scripts then default to non-namespaced.
production:
start:
# Override cmd for production environment
cmd: npm start --production
# Health checks; WIP
health:
- path: /content
script: restart
# Services to enable on container start
services:
- sshd
- rsyslog
- newrelic
# Env vars to set on container start
ENV:
# App environment: development, testing, staging, production, etc.
# Overrideable as cli option.
# Used to determine ~/.airstack/ mount paths and other core actions.
# Each base container should inspect APP_ENV on start up and set other
# env vars as needed; e.g. NODE_ENV, RACK_ENV, etc.
# TODO: automatically set APP_ENV from root.environment
APP_ENV: development
SOME_APP_ENV_STUFF: asdfasdfasdf
# Cluster components
# Auto linked. Env vars from components are exported into the app container with the
# prefix of the component name in caps: DB001_HOST=192.168.0.1, DB001_PORT=1234, ...
components:
# '&' defines an alias for use in duplicating blocks; it's a yaml thing
- &db
name: db001
container:
image: airstack/mysql-cluster
version: ^5.6
ENV:
ENGINE_TYPE: innodb
- # Example of using defaults and setting an explicit name
<<: *db
name: db002
- # Example of special component type that is a duplicate of the app container with modified settings.
# The name of the container in the docker registry will be airstack-blog__worker
name: worker
# Instance names will have appended sequence strings: 001, 002, etc.
# e.g. worker001, worker002, etc.
instances: 3
user: worker
source: ./worker
scripts:
start: npm run --worker
paths:
base: ~/.airstack/
log: log
data: data
# Leave tmp commented out to use OS tmp dir
# tmp: tmp
# Do not change config.
# config: config