Creating first service¶
Service definitions are docker-compose.yml files, with addition of Harbor’s patterns which allows to automate and standardize the way of environment preparation.
- YAML files are stored at
- The naming:
apps.MY-APP-NAME.yamlfor applications, and
infrastructure.MY-TECHNICAL-APP-NAME.yamlfor technical services (health checks, backups etc.)
- Volumes with configuration files eg. nginx.conf - should be in
- Volumes with external git repositories should be in
- Volumes with dynamic data such as user uploads should be in
Let’s create first service then!¶
Best way to create a service is to use a generator - to avoid common mistakes.
harbor :cooperative:sync harbor :cooperative:install harbor/webservice
The below example will sync coop repositories, then use
harbor/webservice template to generate docker-compose yaml file,
that will be placed in
:service:up task to bring up a recently created service.
harbor :service:list harbor :service:up service-name
After checking that everything works correctly the service definition + configuration files placed in
./container directory should be pushed to GIT.