This example Pulumi application runs two containers locally, one Redis container
and one built from the application in the app
folder.
The application queries the Redis database and returns the number of times the page has been viewed.
To run this example, make sure Docker is installed and running.
-
Build the Docker image for the app:
scala-cli --power package --docker app --docker-image-repository app
Note: some values in this example will be different from run to run.
These values are indicated with ***
.
-
Create a new stack, which is an isolated deployment target for this example:
pulumi -C infra stack init docker-multi-container-app-dev
-
Run
pulumi up
to preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not.pulumi -C infra up
-
To see the resources that were created, run
pulumi stack output
:pulumi -C infra stack output
-
Open the site URL in a browser to see the page:
open $(pulumi -C infra stack output url)
-
From there, feel free to experiment. Simply making edits and running pulumi up will incrementally update your infrastructure.
-
To clean up resources, destroy your stack and remove it:
pulumi -C infra destroy
pulumi -C infra stack rm docker-multi-container-app-dev
docker rmi app