1+ # This deploy.yml file is configured to work with the kamal_tf script.
2+ # Please use the kamal_tf script to run kamal commands with dynamic IP addresses from Terraform.
3+ # Example usage: bin/kamal_tf deploy
4+
15# Name of your application. Used to uniquely configure containers.
26service : rails_kamal_demo
37
48# Name of the container image.
5- image : your-user /rails_kamal_demo
9+ image : shakacodedemo /rails_kamal_demo
610
711# Deploy to these servers.
812servers :
9- web :
10- - 192.168.0.1
11- # job:
12- # hosts:
13- # - 192.168.0.1
14- # cmd: bin/jobs
13+ web : # Next value is set by Terraform script "stand-up" in sibling repo
14+ - 34.59.165.111
15+ # job:
16+ # hosts:
17+ # - 34.59.165.111
18+ # cmd: bin/jobs
1519
1620# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
1721# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
1822#
1923# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
24+ # uncomment next line for a real host name
2025proxy :
2126 ssl : true
22- host : app.example.com
27+ # IMPT: Edit for your real host name
28+ host : gcp.kamaltutorial.com
2329
2430# Credentials for your image host.
2531registry :
2632 # Specify the registry server, if you're not using Docker Hub
2733 # server: registry.digitalocean.com / ghcr.io / ...
28- username : your-user
34+ # IMPT: Edit for your real Docker Hub username
35+ username : shakacodedemo
2936
3037 # Always use an access token rather than real password when possible.
3138 password :
@@ -34,12 +41,16 @@ registry:
3441# Inject ENV variables into containers (secrets come from .kamal/secrets).
3542env :
3643 secret :
37- - RAILS_MASTER_KEY
44+ - DB_PASSWORD
45+ - SECRET_KEY_BASE
3846 clear :
3947 # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
4048 # When you start using multiple servers, you should split out job processing to a dedicated machine.
4149 SOLID_QUEUE_IN_PUMA : true
4250
51+ # This is the networking to get to host machine from within the Rails docker container
52+ DB_HOST : 172.18.0.1
53+
4354 # Set number of processes dedicated to Solid Queue (default: 1)
4455 # JOB_CONCURRENCY: 3
4556
@@ -61,13 +72,11 @@ aliases:
6172 logs : app logs -f
6273 dbc : app exec --interactive --reuse "bin/rails dbconsole"
6374
64-
6575# Use a persistent storage volume for sqlite database files and local Active Storage files.
6676# Recommended to change this to a mounted volume path that is backed up off server.
6777volumes :
6878 - " rails_kamal_demo_storage:/rails/storage"
6979
70-
7180# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
7281# hitting 404 on in-flight requests. Combines all files from new and old
7382# version inside the asset_path.
@@ -88,8 +97,8 @@ builder:
8897 # - RAILS_MASTER_KEY
8998
9099# Use a different ssh user than root
91- # ssh:
92- # user: app
100+ ssh :
101+ user : justin
93102
94103# Use accessory services (secrets come from .kamal/secrets).
95104# accessories:
@@ -114,3 +123,7 @@ builder:
114123# port: 6379
115124# directories:
116125# - data:/data
126+
127+ # Configure rolling deploys by setting a wait time between batches of restarts.
128+ # 30 is the default. First deploy will need a longer time to create the database.
129+ deploy_timeout : 30
0 commit comments