The example directory has two directories: backend and frontend. Each contains simple application with a Dockerfile. We'll first define a boilerplate Garden project, and then Garden action configurations for each application.
To initialize the project use a helper command:
gardencreateproject
This will create a basic boilerplate project configuration in the current directory, making it our project root.
We have three environments (local, remote and staging) and also three provider configurations, one for each environment.
For this step, we'll focus on the local environment. You can ignore the others for now.
Next, let's create action configs for each of our two applications, starting with backend.
First we need to define Build and Deploy actions for the backend application. Let's use container action type. Create an empty backend.garden.yml config file in the backend directory and add the following lines:
kind:Buildname:backenddescription:Backend service container imagetype:container---kind:Deployname:backenddescription:Backend service containertype:container# Reference to the Build action that builds the image to be deployed (defined above)build:backend# Action type specific config goes under the `spec` blockspec:healthCheck:httpGet:path:/hello-backendport:httpports: - name:httpcontainerPort:8080servicePort:80ingresses: - path:/hello-backendport:http
Next, let's do the same for the frontend application: Create a frontend.garden.yml config file in the frontend directory and add the following lines:
kind:Buildname:frontenddescription:Frontendservicecontainerimagetype: container---kind:Deployname:frontenddescription:Frontendservicecontainertype: containerbuild:frontend# Dependency section is used to specify action execution order. The frontend will be deployed after the backend is deployed.
# Dependency for the Build action is implicit.dependencies:-deploy.backendspec:ports:-name:httpcontainerPort:8080healthCheck:httpGet:path:/hello-frontendport:httpingresses:-path:/hello-frontendport:http-path:/call-backendport:http