-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathdeploy.yml
More file actions
78 lines (70 loc) 路 2.25 KB
/
Copy pathdeploy.yml
File metadata and controls
78 lines (70 loc) 路 2.25 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
# Name of your application. Used to uniquely configure containers.
service: forem
# Name of the container image.
image: forem/forem
# Deploy to these servers.
servers:
web:
hosts:
- <%= ENV["KAMAL_WEB_IP"] || "192.168.0.1" %>
cmd: bundle exec puma -C config/puma.rb
job:
hosts:
- <%= ENV["KAMAL_JOB_IP"] || "192.168.0.1" %>
cmd: bundle exec sidekiq -t 25
# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
proxy:
ssl: true
host: example.com # Replace with your domain name
app_port: 3000
# Credentials for your image host.
registry:
server: ghcr.io
username: your_username # Replace with your GHCR username
# Always use an access token rather than real password (pulled from .kamal/secrets).
password:
- KAMAL_REGISTRY_PASSWORD
# Configure builder setup.
builder:
arch: amd64
# Our Dockerfile has a multi-stage build, target "production" to get the lean final image.
target: production
# Inject ENV variables into containers (secrets come from .kamal/secrets).
env:
clear:
PORT: 3000
RAILS_ENV: production
NODE_ENV: production
RAILS_SERVE_STATIC_FILES: "true"
REDIS_URL: redis://forem-redis:6379/1
REDIS_SIDEKIQ_URL: redis://forem-redis:6379/3
REDIS_SESSIONS_URL: redis://forem-redis:6379/4
REDIS_RPUSH_URL: redis://forem-redis:6379/5
secret:
- RAILS_MASTER_KEY
- DATABASE_URL
# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
# hitting 404 on in-flight requests. Combines all files from new and old
# version inside the asset_path.
asset_path: /opt/apps/forem/public/assets
# Use accessory services (secrets come from .kamal/secrets).
accessories:
postgres:
image: pgvector/pgvector:pg13
host: <%= ENV["KAMAL_DB_IP"] || "192.168.0.1" %>
port: 5432
env:
clear:
POSTGRES_USER: postgres
POSTGRES_DB: forem_production
secret:
- POSTGRES_PASSWORD
directories:
- /var/lib/postgresql/data:/var/lib/postgresql/data
redis:
image: redis:7.0-alpine
host: <%= ENV["KAMAL_REDIS_IP"] || "192.168.0.1" %>
port: 6379
directories:
- /data:/data