Repository navigation
Expand file tree
/
Copy pathdeploy.example.yml
More file actions
126 lines (115 loc) · 3.48 KB
/
Copy pathdeploy.example.yml
File metadata and controls
126 lines (115 loc) · 3.48 KB
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
# This deployment example is perfectly fits for deploying on machine in a network using corporate CA.
#
# - it assumes you have private network for Docker created in advance: `docker network create --driver bridge private`
# - it assumes you have directory /etc/ssl/asap/certs/ containing private key and certificate signed with your corp CA
# - it assumes you have /etc/ssl/asap/dyn.yml with following content
# tls:
# certificates:
# - certFile: /etc/traefik/certs/web.crt
# keyFile: /etc/traefik/certs/privkey.pem
#
# If you want to add a corp root CA cert to system trust store, simply put PEM-formatted .crt file in config/ directory before deploy
#
# Deploying public instance with Let's encrypt certs is even simpler, see Kamal guides.
#
# For user provisionning and other cron jobs (e.g. close_expired_alerts), this deploys separate container.
service: asap
# Your image name.
image: repo_name/asap
registry:
# Specify the registry server, if you're not using Docker Hub
# server: registry.digitalocean.com / ghcr.io / ...
server: ghcr.io
username: sa_security_team
# Always use an access token rather than real password when possible.
password:
- KAMAL_REGISTRY_PASSWORD
servers:
web:
hosts:
- asap.example.com
labels:
traefik.enable: true
traefik.http.routers.asap-web.rule: Host(`asap.example.com`)
traefik.http.routers.asap-web.entrypoints: websecure
traefik.http.routers.asap-web.tls: true
options:
network: "private"
cron:
hosts:
- asap.example.com
cmd: bash -c "cat config/crontab | crontab - && declare -p | grep -Ev '\b(BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID)\b' >> /rails/.cron.env && cron -f"
options:
user: root
network: "private"
# Use a different ssh user than root
# ssh:
# user: app
# Inject ENV variables into containers (secrets come from .env).
# Remember to run `kamal env push` after making changes!
env:
clear:
RAILS_ENV: production
RAILS_SERVE_STATIC_FILES: true
RAILS_LOG_TO_STDOUT: true
DB_HOST: asap-db
HOSTNAME: asap.example.com
AUTH_METHOD: sso
secret:
- RAILS_MASTER_KEY
- POSTGRES_PASSWORD
- API_TOKEN
- OIDC_HOSTNAME
- OIDC_ISSUER
- OIDC_AUTHORIZATION_ENDPOINT
- OIDC_TOKEN_ENDPOINT
- OIDC_USERINFO_ENDPOINT
- OIDC_IDENTIFIER
- OIDC_SECRET
- OIDC_REDIRECT_URI
- LDAP_HOST
- LDAP_BASE
- LDAP_USERNAME
- LDAP_PASSWORD
- LDAP_USERS_FILTER
- LDAP_USERS_SEARCHBASE
# Use accessory services (secrets come from .env).
accessories:
db:
image: postgres:14.0
host: asap.example.com
env:
clear:
POSTGRES_USER: asap
POSTGRES_DB: asap_production
secret:
- POSTGRES_PASSWORD
files:
- db/production.sql:/docker-entrypoint-initdb.d/setup.sql
directories:
- data:/var/lib/postgresql/data
options:
network: "private"
traefik:
options:
volume:
- /etc/ssl/asap/certs:/etc/traefik/certs:ro
- /etc/ssl/asap/dyn.yml:/etc/traefik/dyn.yml
publish:
- "443:443"
network: "private"
args:
entryPoints.websecure.address: ":443"
log.level: INFO
entryPoints.web.http.redirections.entryPoint.to: websecure
entryPoints.web.http.redirections.entryPoint.scheme: https
entryPoints.web.http.redirections.entrypoint.permanent: true
providers.file.filename: /etc/traefik/dyn.yml
builder:
args:
RUBY_VERSION: 3.2.0
remote:
arch: amd64
healthcheck:
path: /login
port: 3000