For developers
Project configuration
2 min
requirements hosty cli requires projects to use git as a version control system git hashes are used to calculate build hash of the code to avoid rebuild of docker images if hash does not change configuration file hosting configuration for a project is represented by hosty yaml file located in hosty folder relative to the project's root ( hosty/hosty yaml ) below you can find a full example of configuration file with list of configuration options \# name of the hosting cluster provided by hosting administrators clustername unicorn \# aws region name of the hosting cluster provided by hosting administrators clusterregion eu west 2 \# name of the project provided by hosting administrators projectname example \# list of project services services \# adds a redis service to the project in this case, \# each application will have the following env variables \# redis host \# redis port \# redis password redis \# size (in mb) of the redis storage size 256 \# list of project applications (usually there's only 1, but multiple applications are supported too) applications \# arbitrary name of the application backend \# allowed application types \# php\ nginx \# php\ apache \# node \# python\ nginx type php\ nginx \# path to the application folder relative to the project root approot /drupal \# list of additional files or folders to track to make hosty aware that docker images for \# the environment have to be rebuilt if these files have been changed and committed to the git repo \# by default, only "approot" folder is tracked for changes \# specify a list of paths relative to the project root extrabuilddependencies \ / circleci \# nginx web server configuration \# relevant only when "php\ nginx" application type is chosen \# for nginx, we use https //github com/wodby/nginx docker image, \# so you can check the repository to see the full list of configuration \# options through environment variables nginx \# supported versions can be found on this page https //github com/wodby/nginx?tab=readme ov file#docker images version 1 25 \# specify a tag of a docker image to use \# important note hosty automatically picks up the latest tag on deployment, \# so for security reasons, we highly don't recommend hardcoding a tag version \# however, if a certain tag version of the docker image causes issues, it \# can be used as a temporary workaround until the issue with docker image is solved \# list of supported tags can be found at https //github com/wodby/nginx/tags \#tag 5 38 0 \# environment variables for nginx container \# you can find a full list of variables at https //github com/wodby/nginx?tab=readme ov file#environment variables environmentvariables \# the application root folder is always mapped to "/var/www/html", so \# specify here an absolute path to the web server root by replacing \# your "approot" with "/var/www/html" nginx server root /var/www/html/web \# for drupal and wordpress, the docker image has pre defined presets \# for improved developer experience and security nginx vhost preset drupal10 \# apache web server configuration \# relevant only when "php\ apache" application type is chosen \# for apache we use https //github com/wodby/apache docker image, \# so you can check the repository to see the full list of configuration \# options through environment variables apache \# supported versions can be found on this page https //github com/wodby/apache?tab=readme ov file#docker images version 2 4 \# specify a tag of a docker image to use \# important note hosty automatically picks up the latest tag on deployment, \# so for security reasons we highly don't recommend hardcoding a tag version \# however, if a certain tag version of the docker image would cause issues, it \# can be used as a temporary workaround until the issue with docker image is solved \# list of supported tags can be found at https //github com/wodby/apache/tags \#tag 4 14 3 \# environment variables for apache container \# you can find full list of variables at https //github com/wodby/apache?tab=readme ov file#environment variables environmentvariables \# the application root folder is always mapped to "/var/www/html", so \# specify here absolute path to the web server root by replacing \# your "approot" with "/var/www/html" apache document root /var/www/html/web \# php configuration \# relevant only when "php\ nginx" or "php\ apache" application type is chosen \# for php, we use https //github com/wodby/php docker image, \# so you can check the repository to see the full list of configuration \# options through environment variables php \# supported versions can be found on this page https //github com/wodby/php?tab=readme ov file#docker images version 8 3 \# specify a tag of a docker image to use \# important note hosty automatically picks up the latest tag on deployment, \# so for security reasons, we highly don't recommend hard coding a tag version \# however, if a certain tag version of the docker image causes issues, it \# can be used as a temporary workaround until the issue with docker image is solved \# list of supported tags can be found at https //github com/wodby/php/tags \#tag 4 52 2 \# environment variables for php container \# you can find a full list of variables at https //github com/wodby/php?tab=readme ov file#environment variables environmentvariables \# environment variables support placeholders for several \# global variables available at deployment \# {{ projectname }} \# {{ clustername }} \# {{ environmentname }} \# also, it supports several applications specific placeholders \# you need to replace $applicationname with the actual name of your application \# specified in this hosty yaml file \# {{ $applicationname name }} \# replace $index with the index of host you need to use \# by default, there's just 1 host per application, so the $index is 0 \# if you add more hosts to the application, then you can access their placeholders \# by increasing $index value \# {{ $applicationname host $index }} backend host "{{ backend host 0 }}" application mode development \# path to key/value env files with environment variables \# path is relative to the project root environmentfiles \ / env secrets \# script to build app dependencies from sources hooks build | set eu composer install no interaction \# adds a database to the application database \# currently only mysql database type is supported type mysql \# list of table names to exclude content from \# when importing database backup into development environments \# use "%" wildcard symbol to add all table names matching the pattern \# the hosting makes 2 types of backup full and partial \# full backup contains the exact snapshot of the database "as is" \# partial backup contains backup with content excluded from tables \# listed below \# partial backup is used to spin up all development environments \# it is recommended to exclude cache tables and tables with personal \# identifiable information for faster environments spin up and security reasons excludetablesfromimportondevenvs \ cache% \ sessions \ user% \# list of cron jobs \# schedule conforms with the usual crontab syntax \# cron jobs are disabled on development environments by default crontab enabled true jobs \ schedule "15 /6 " command drush cron \# list of persistent file storages mounted to the application persistentstorages \# arbitrary name of the storage public \# path must be relative to the application root (approot) and should not include leading " /" path web/sites/default/files \# optional list of arguments to use when importing files from s3 backup to a new \# development environments using "aws s3 sync" command syncargsfordevenvs exclude=styles/ exclude=css/ exclude=js/ \# arbitrary name of the storage private \# path must be relative to the application root (approot) and should not include leading " /" path private \# optional list of arguments to use when importing files from s3 backup to a new \# development environments using "aws s3 sync" command syncargsfordevenvs exclude=twig/ \# if you don't need to use "syncargsfordevenvs", then you can specify \# persistent storage in shorter format as "\<storagename> \<pathrelativetoapproot>", like on the example below tmp tmp \# list of host names (domains) assigned to the environment \# see "overrides" section for an example how to assign a real domain name to a particular environment \#hosts \# by default, the hosting automatically assigns a host name based on the following pattern \# "{{ $applicationname name }} {{ environmentname }} {{ projectname }} {{ hostedzone }}" \# for example \# "{{ drupal name }} {{ environmentname }} {{ projectname }} {{ hostedzone }}" \# configuration overrides for specific environments overrides \# at the moment, we support only a list of environment names \# as conditions for overrides \# below is an example override for the stage environment \ condition \# the list of environments this overrides applies to environments \[ stage ] \# the rest of the override uses the same hierarchy as the \# default application configuration, so you can override \# whatever you wish php environmentvariables application mode staging \# at the moment, we support only a list of environment names \# as conditions for overrides \# below is an example override for the production environment \ condition \# the list of environments this overrides applies to environments \[ production ] \# optional setting to reverse the logic of condition to apply \# if set to "true", then the override will be applied to all environments \# apart from the production environment negate false \# assign a custom domain name to the application \# see "adding a custom domain" documentation page for more details hosts \ example com \# the rest of the override uses the same hierarchy as the \# default application configuration, so you can override \# whatever you wish php environmentvariables application mode production \# specify a new cron schedule different from the default one \# for all other environments crontab \#enabled true jobs \ schedule "0 /1 " command drush cron