xinity / avatars-demo

Sample project for the Tilt getting started tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker Samples :: Avatars 🤪

Avatars is a small sample project for Docker demonstration purposes.

It consists of a Python web API backend to generate avatars and a Javascript SPA (single page app) frontend. If you are not a Python or Javascript guru, don't panic!

Usage

To get started, clone this repository locally:

git clone https://github.com/dockersamples/avatars.git

All subsequent commands assume they are run from the root repository directory (i.e. avatars/ folder).

Run make help to see a list of available targets.

Tilt

You'll need to first install Tilt and prerequisites (Docker + development Kubernetes cluster).

Run tilt up or make tilt. All resources will be deployed to the namespace and cluster as determined by the active Kubernetes config context.

Docker Compose with file watch

Run make compose.

Compose launches the services and attaches in file watch mode. Run docker compose -p avatars logs -f from a separate terminal to stream logs.

Kubernetes (Docker Desktop)

ℹ️ If you haven't already, open the Docker Desktop dashboard and enable Kubernetes from Settings > Kubernetes > ☑️ Enable Kubernetes and apply.

Run make kubernetes. All resources will be deployed to the avatars namespace in the docker-desktop Kubernetes cluster.

Buildx builds images and Kubernetes creates Deployments and Services. The images are not pushed to a registry, as Docker Desktop's Kubernetes integration runs the images directly from the Docker Engine image store using cri-dockerd (formerly known as dockershim).

Run `kubectl --context=docker-desktop --namespace=avatars logs -l='app.kubernetes.io/part-of=dockersamples_avatars' from a separate terminal to stream logs.

Simple Compose Watch Test

git clone https://github.com/dockersamples/avatars
cd avatars
docker compose up -d

Initiate the Watch

docker compose watch

Generate a graphviz graph from your compose file

docker compose alpha viz

About

Sample project for the Tilt getting started tutorial


Languages

Language:JavaScript 38.2%Language:Starlark 21.8%Language:Python 17.2%Language:CSS 9.9%Language:Makefile 5.8%Language:Dockerfile 3.7%Language:HTML 2.2%Language:HCL 1.2%