Building directly from a checkout will pull in uncommitted files to or more sneakily files that are git ignored, but not docker ignored. To avoid this, we'll add an option to build from a git archive of HEAD instead. Docker doesn't provide a way to build directly from a git repo, so instead we create a tarball of the current HEAD with git archive and pipe it into the build command. When building from a git archive, we'll still display the warning about uncommitted changes, but we won't add the `_uncommitted_...` suffix to the container name as they won't be included in the build. Perhaps this should be the default, but we'll leave that decision for now.
104 lines
2.7 KiB
YAML
104 lines
2.7 KiB
YAML
# Name of your application. Used to uniquely configure containers.
|
|
service: my-app
|
|
|
|
# Name of the container image.
|
|
image: user/my-app
|
|
|
|
# Deploy to these servers.
|
|
servers:
|
|
- 192.168.0.1
|
|
|
|
# Credentials for your image host.
|
|
registry:
|
|
# Specify the registry server, if you're not using Docker Hub
|
|
# server: registry.digitalocean.com / ghcr.io / ...
|
|
username: my-user
|
|
|
|
# Always use an access token rather than real password when possible.
|
|
password:
|
|
- KAMAL_REGISTRY_PASSWORD
|
|
|
|
# Inject ENV variables into containers (secrets come from .env).
|
|
# Remember to run `kamal env push` after making changes!
|
|
# env:
|
|
# clear:
|
|
# DB_HOST: 192.168.0.2
|
|
# secret:
|
|
# - RAILS_MASTER_KEY
|
|
|
|
# Use a different ssh user than root
|
|
# ssh:
|
|
# user: app
|
|
|
|
# Configure builder setup.
|
|
# Set git_archive: true to build from a git archive of HEAD
|
|
# builder:
|
|
# args:
|
|
# RUBY_VERSION: 3.2.0
|
|
# secrets:
|
|
# - GITHUB_TOKEN
|
|
# remote:
|
|
# arch: amd64
|
|
# host: ssh://app@192.168.0.1
|
|
# git_archive: false
|
|
|
|
# Use accessory services (secrets come from .env).
|
|
# accessories:
|
|
# db:
|
|
# image: mysql:8.0
|
|
# host: 192.168.0.2
|
|
# port: 3306
|
|
# env:
|
|
# clear:
|
|
# MYSQL_ROOT_HOST: '%'
|
|
# secret:
|
|
# - MYSQL_ROOT_PASSWORD
|
|
# files:
|
|
# - config/mysql/production.cnf:/etc/mysql/my.cnf
|
|
# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
|
|
# directories:
|
|
# - data:/var/lib/mysql
|
|
# redis:
|
|
# image: redis:7.0
|
|
# host: 192.168.0.2
|
|
# port: 6379
|
|
# directories:
|
|
# - data:/data
|
|
|
|
# Configure custom arguments for Traefik
|
|
# traefik:
|
|
# args:
|
|
# accesslog: true
|
|
# accesslog.format: json
|
|
|
|
# Configure a custom healthcheck (default is /up on port 3000)
|
|
# healthcheck:
|
|
# path: /healthz
|
|
# port: 4000
|
|
|
|
# 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.
|
|
#
|
|
# If your app is using the Sprockets gem, ensure it sets `config.assets.manifest`.
|
|
# See https://github.com/basecamp/kamal/issues/626 for details
|
|
#
|
|
# asset_path: /rails/public/assets
|
|
|
|
# Configure rolling deploys by setting a wait time between batches of restarts.
|
|
# boot:
|
|
# limit: 10 # Can also specify as a percentage of total hosts, such as "25%"
|
|
# wait: 2
|
|
|
|
# Configure the role used to determine the primary_host. This host takes
|
|
# deploy locks, runs health checks during the deploy, and follow logs, etc.
|
|
#
|
|
# Caution: there's no support for role renaming yet, so be careful to cleanup
|
|
# the previous role on the deployed hosts.
|
|
# primary_role: web
|
|
|
|
# Controls if we abort when see a role with no hosts. Disabling this may be
|
|
# useful for more complex deploy configurations.
|
|
#
|
|
# allow_empty_roles: false
|