Create config stub with mrsk:init

This commit is contained in:
David Heinemeier Hansson
2023-01-08 13:39:29 +01:00
parent 4f06b5f99b
commit d43ceb975f
3 changed files with 30 additions and 8 deletions

View File

@@ -13,8 +13,11 @@ namespace :mrsk do
desc "Display information about Traefik and app containers"
task info: [ "traefik:info", "app:info" ]
desc "Create config stub"
desc "Create config stub in config/deploy.yml"
task :init do
Rails.root.join("config/deploy.yml")
require "fileutils"
FileUtils.cp_r \
Pathname.new(File.expand_path("templates/deploy.yml", __dir__)),
Rails.root.join("config/deploy.yml"))
end
end

View File

@@ -0,0 +1,20 @@
# Name of your application will be used for uniquely configuring Traefik and app containers
service: my-app
# Name of the container image
image: user/chat
# All the servers targeted for deploy. You can reference a single server for a command by using SERVERS=xxx.xxx.xxx.xxx
servers:
- xxx.xxx.xxx.xxx
# The following envs are made available to the container when started
env:
# Remember never to put passwords or tokens directly into this file, use encrypted credentials
# REDIS_URL: redis://x/y
registry:
# Specify the registry server, if you're not using Docker Hub
# server: registry.digitalocean.com / ghcr.io / ...
username: <%= Rails.application.credentials.registry["username"] %>
password: <%= Rails.application.credentials.registry["password"] %>