diff --git a/README.md b/README.md
index 0323edd..50076f9 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,7 @@
These samples provide a starting point for how to integrate different services using a Compose file and to manage their deployment with Docker Compose.
-> **Note:**
->
+> **Note**
> The following samples are intended for use in local development environments such as project setups, tinkering with software stacks, etc. These samples must not be deployed in production environments.
@@ -18,56 +17,71 @@ These samples provide a starting point for how to integrate different services u
- [Basic setups for different platforms (not production ready - useful for personal use)](#basic-setups-for-different-platforms-not-production-ready---useful-for-personal-use).
## Samples of Docker Compose applications with multiple integrated services
-- [`ASP.NET / MS-SQL`](https://github.com/docker/awesome-compose/tree/master/aspnet-mssql) - Sample ASP.NET core application
+
+ Icon indicates Sample is compatible with [Docker Dev Environments](https://docs.docker.com/desktop/dev-environments/) in Docker Desktop version 4.10 or later.
+
+ Icon indicates Sample is compatible with [Docker+Wasm](https://docs.docker.com/desktop/wasm/).
+
+- [`ASP.NET / MS-SQL`](aspnet-mssql) - Sample ASP.NET core application
with MS SQL server database.
-- [`Elasticsearch / Logstash / Kibana`](https://github.com/docker/awesome-compose/tree/master/elasticsearch-logstash-kibana) - Sample Elasticsearch, Logstash, and Kibana stack.
-- [`Go / NGINX / MySQL`](https://github.com/docker/awesome-compose/tree/master/nginx-golang-mysql) - Sample Go application
-with an Nginx proxy and a MySQL database.
-- [`Go / NGINX / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/nginx-golang-postgres) - Sample Go
-application with an Nginx proxy and a PostgreSQL database.
-- [`Java Spark / MySQL`](https://github.com/docker/awesome-compose/tree/master/sparkjava-mysql) - Sample Java application and
-a MySQL database.
-- [`NGINX / ASP.NET / MySQL`](https://github.com/docker/awesome-compose/tree/master/nginx-aspnet-mysql) - Sample Nginx reverse proxy with an C# backend using ASP.NET
-- [`NGINX / Flask / MongoDB`](https://github.com/docker/awesome-compose/tree/master/nginx-flask-mongo) - Sample Python/Flask
-application with Nginx proxy and a Mongo database.
-- [`NGINX / Flask / MySQL`](https://github.com/docker/awesome-compose/tree/master/nginx-flask-mysql) - Sample Python/Flask application with an Nginx proxy and a MySQL database.
-- [`NGINX / Node.js / Redis`](https://github.com/docker/awesome-compose/tree/master/nginx-nodejs-redis) - Sample Node.js application with Nginx proxy and a Redis database
-- [`NGINX / Go`](https://github.com/docker/awesome-compose/tree/master/nginx-golang) - Sample Nginx proxy with a Go backend.
-- [`NGINX / WSGI / Flask`](https://github.com/docker/awesome-compose/tree/master/nginx-wsgi-flask) - Sample Nginx reverse proxy with a Flask backend using WSGI.
-- [`PostgreSQL / pgAdmin`](https://github.com/docker/awesome-compose/tree/master/postgresql-pgadmin) - Sample setup for postgreSQL database with pgAdmin web interface
-- [`Python / Flask / Redis`](https://github.com/docker/awesome-compose/tree/master/flask-redis) - Sample Python/Flask and a Redis database
-- [`React / Spring / MySQL`](https://github.com/docker/awesome-compose/tree/master/react-java-mysql) - Sample React
-application with a Spring backend and a MySQL database.
-- [`React / Express / MySQL`](https://github.com/docker/awesome-compose/tree/master/react-express-mysql) - Sample React
-application with a Node.js backend and a MySQL database.
-- [`React / Express / MongoDB`](https://github.com/docker/awesome-compose/tree/master/react-express-mongodb) - Sample React
-application with a Node.js backend and a Mongo database.
-- [`React / Rust / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/react-rust-postgres) - Sample React
-application with a Rust backend and a Postgres database.
-- [`React / Nginx`](https://github.com/docker/awesome-compose/tree/master/react-nginx) - Sample React application with Nginx.
-- [`Spring / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/spring-postgres) - Sample Java application
-with Spring framework and a Postgres database.
+- [`Elasticsearch / Logstash / Kibana`](elasticsearch-logstash-kibana) - Sample Elasticsearch, Logstash, and Kibana stack.
+- [`Go / NGINX / MySQL`](nginx-golang-mysql) - Sample Go application
+with an Nginx proxy and a MySQL database.
+- [`Go / NGINX / PostgreSQL`](nginx-golang-postgres) - Sample Go
+application with an Nginx proxy and a PostgreSQL database.
+- [`Java Spark / MySQL`](sparkjava-mysql) - Sample Java application and
+a MySQL database.
+- [`NGINX / ASP.NET / MySQL`](nginx-aspnet-mysql) - Sample Nginx reverse proxy with an C# backend using ASP.NET
+- [`NGINX / Flask / MongoDB`](nginx-flask-mongo) - Sample Python/Flask
+application with Nginx proxy and a Mongo database.
+- [`NGINX / Flask / MySQL`](nginx-flask-mysql) - Sample Python/Flask application with an Nginx proxy and a MySQL database.
+- [`NGINX / Node.js / Redis`](nginx-nodejs-redis) - Sample Node.js application with Nginx proxy and a Redis database
+- [`NGINX / Go`](nginx-golang) - Sample Nginx proxy with a Go backend.
+- [`NGINX / WSGI / Flask`](nginx-wsgi-flask) - Sample Nginx reverse proxy with a Flask backend using WSGI.
+- [`PostgreSQL / pgAdmin`](postgresql-pgadmin) - Sample setup for postgreSQL database with pgAdmin web interface
+- [`Python / Flask / Redis`](flask-redis) - Sample Python/Flask and a Redis database
+- [`React / Spring / MySQL`](react-java-mysql) - Sample React
+application with a Spring backend and a MySQL database.
+- [`React / Express / MySQL`](react-express-mysql) - Sample React
+application with a Node.js backend and a MySQL database.
+- [`React / Express / MongoDB`](react-express-mongodb) - Sample React
+application with a Node.js backend and a Mongo database.
+- [`React / Rust / PostgreSQL`](react-rust-postgres) - Sample React
+application with a Rust backend and a Postgres database.
+- [`React / Nginx`](react-nginx) - Sample React application with Nginx.
+- [`Spring / PostgreSQL`](spring-postgres) - Sample Java application
+with Spring framework and a Postgres database.
+- [`WasmEdge / MySQL / Nginx`](wasmedge-mysql-nginx) - Sample Wasm-based web application with a static HTML frontend, using a MySQL (MariaDB) database. The frontend connects to a Wasm microservice written in Rust, that runs using the WasmEdge runtime.
+- [`WasmEdge / Kafka / MySQL`](wasmedge-kafka-mysql) - Sample Wasm-based microservice that subscribes to a Kafka (Redpanda) queue topic, and transforms and saves any incoming message into a MySQL (MariaDB) database.
+
## Single service samples
-- [`Angular`](https://github.com/docker/awesome-compose/tree/master/angular)
-- [`Spark`](https://github.com/docker/awesome-compose/tree/master/sparkjava)
-- [`VueJS`](https://github.com/docker/awesome-compose/tree/master/vuejs)
-- [`Flask`](https://github.com/docker/awesome-compose/tree/master/flask)
-- [`PHP`](https://github.com/docker/awesome-compose/tree/master/apache-php)
-- [`Traefik`](https://github.com/docker/awesome-compose/tree/master/traefik-golang)
-- [`Django`](https://github.com/docker/awesome-compose/tree/master/django)
+
+ Icon indicates Sample is compatible with [Docker Dev Environments](https://docs.docker.com/desktop/dev-environments/) in Docker Desktop version 4.10 or later.
+
+- [`Angular`](angular)
+- [`Spark`](sparkjava)
+- [`VueJS`](vuejs)
+- [`Flask`](flask)
+- [`PHP`](apache-php)
+- [`Traefik`](traefik-golang)
+- [`Django`](django)
- [`Minecraft server`](https://github.com/docker/awesome-compose/tree/master/minecraft)
- [`Plex`](https://github.com/docker/awesome-compose/tree/master/plex)
- [`Portainer`](https://github.com/docker/awesome-compose/tree/master/portainer)
- [`Wireguard`](https://github.com/docker/awesome-compose/tree/master/wireguard)
-## Basic setups for different platforms (not production ready - useful for personal use)
-- [`Gitea / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/gitea-postgres)
-- [`Nextcloud / PostgreSQL`](https://github.com/docker/awesome-compose/tree/master/nextcloud-postgres)
-- [`Nextcloud / Redis / MariaDB`](https://github.com/docker/awesome-compose/tree/master/nextcloud-redis-mariadb)
-- [`Pi-hole / cloudflared`](https://github.com/docker/awesome-compose/tree/master/pihole-cloudflared-DoH) - Sample Pi-hole setup with use of DoH cloudflared service
-- [`Prometheus / Grafana`](https://github.com/docker/awesome-compose/tree/master/prometheus-grafana)
-- [`Wordpress / MySQL`](https://github.com/docker/awesome-compose/tree/master/wordpress-mysql)
+- [`FastAPI`](fastapi)
+
+## Basic setups for different platforms (not production ready - useful for personal use)
+
+- [`Gitea / PostgreSQL`](gitea-postgres)
+- [`Nextcloud / PostgreSQL`](nextcloud-postgres)
+- [`Nextcloud / Redis / MariaDB`](nextcloud-redis-mariadb)
+- [`Pi-hole / cloudflared`](pihole-cloudflared-DoH) - Sample Pi-hole setup with use of DoH cloudflared service
+- [`Prometheus / Grafana`](prometheus-grafana)
+- [`Wordpress / MySQL`](wordpress-mysql)
+
## Getting started
These instructions will get you through the bootstrap phase of creating and
@@ -99,6 +113,11 @@ To stop and remove all containers of the sample application run:
```console
docker compose down
```
+
+### Quickstart guides
+
+In addition to all the ready to run Compose samples listed above the folder [official-documentation-samples](official-documentation-samples/README.md) contains quickstart guides. Each of these step by step guides explain which files need to be created to build and run a Docker Compose application.
+
## Contribute
diff --git a/angular/README.md b/angular/README.md
index b0a05a3..6d164a6 100644
--- a/angular/README.md
+++ b/angular/README.md
@@ -1,4 +1,11 @@
## Compose sample
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/angular)
+
### Angular service
Project structure:
@@ -65,14 +72,3 @@ Stop and remove the container
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/angular
-```
diff --git a/apache-php/README.md b/apache-php/README.md
index 908faf4..7179b8f 100644
--- a/apache-php/README.md
+++ b/apache-php/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/apache-php)
+
### PHP application with Apache2
Project structure:
@@ -54,14 +61,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/apache-php
-```
diff --git a/dev-envs.png b/dev-envs.png
deleted file mode 100644
index b318c78..0000000
Binary files a/dev-envs.png and /dev/null differ
diff --git a/django/README.md b/django/README.md
index 16a5cc3..53c97f5 100644
--- a/django/README.md
+++ b/django/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/django)
+
### Django application in dev mode
Project structure:
@@ -50,10 +57,3 @@ Stop and remove the containers
```
$ docker compose down
```
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly the web service inside a container, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/django`
-
-
\ No newline at end of file
diff --git a/fastapi/README.md b/fastapi/README.md
index 4d20eea..13434de 100644
--- a/fastapi/README.md
+++ b/fastapi/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/fastapi)
+
### Python/FastAPI application
Project structure:
@@ -51,14 +58,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/fastapi
-```
diff --git a/flask-redis/README.md b/flask-redis/README.md
index 01e3256..f9dfd03 100644
--- a/flask-redis/README.md
+++ b/flask-redis/README.md
@@ -1,5 +1,11 @@
## Compose sample application
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/flask-redis)
+
### Python/Flask application using a Redis database
Project structure:
@@ -80,14 +86,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/flask-redis
-```
diff --git a/flask/README.md b/flask/README.md
index 36e78d5..c8b0efd 100644
--- a/flask/README.md
+++ b/flask/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/flask)
+
### Python/Flask application
Project structure:
@@ -55,14 +62,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/flask
-```
diff --git a/icon_devenvs.svg b/icon_devenvs.svg
new file mode 100644
index 0000000..80830fe
--- /dev/null
+++ b/icon_devenvs.svg
@@ -0,0 +1,8 @@
+
diff --git a/icon_wasm.svg b/icon_wasm.svg
new file mode 100644
index 0000000..001cb62
--- /dev/null
+++ b/icon_wasm.svg
@@ -0,0 +1,13 @@
+
diff --git a/nginx-aspnet-mysql/README.md b/nginx-aspnet-mysql/README.md
index 503eda9..e18863c 100644
--- a/nginx-aspnet-mysql/README.md
+++ b/nginx-aspnet-mysql/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/nginx-aspnet-mysql)
+
### ASP.NET server with an Nginx proxy and a MySQL database
Project structure:
@@ -75,14 +82,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/nginx-aspnet-mysql
-```
diff --git a/nginx-flask-mongo/README.md b/nginx-flask-mongo/README.md
index 5838d80..97fa9ff 100644
--- a/nginx-flask-mongo/README.md
+++ b/nginx-flask-mongo/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/nginx-flask-mongo)
+
### Python/Flask application with Nginx proxy and a Mongo database
Project structure:
@@ -69,14 +76,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/nginx-flask-mongo
-```
diff --git a/nginx-flask-mysql/README.md b/nginx-flask-mysql/README.md
index 2d21a39..291612c 100644
--- a/nginx-flask-mysql/README.md
+++ b/nginx-flask-mysql/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/nginx-flask-mysql)
+
### Python/Flask with Nginx proxy and MySQL database
Project structure:
@@ -77,14 +84,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/nginx-flask-mysql
-```
diff --git a/nginx-golang-mysql/README.md b/nginx-golang-mysql/README.md
index 16c403b..1696a85 100644
--- a/nginx-golang-mysql/README.md
+++ b/nginx-golang-mysql/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/nginx-golang-mysql)
+
### Go server with an Nginx proxy and a MariaDB/MySQL database
Project structure:
@@ -90,14 +97,3 @@ Stop and remove the containers
```shell
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/nginx-golang-mysql
-```
diff --git a/nginx-golang-postgres/README.md b/nginx-golang-postgres/README.md
index 87170bc..1671ec8 100644
--- a/nginx-golang-postgres/README.md
+++ b/nginx-golang-postgres/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/nginx-golang-postgres)
+
### Go server with an Nginx proxy and a Postgres database
Project structure:
@@ -80,14 +87,3 @@ Stop and remove the containers
```shell
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/nginx-golang-postgres
-```
diff --git a/nginx-golang/README.md b/nginx-golang/README.md
index b4d0853..506626b 100644
--- a/nginx-golang/README.md
+++ b/nginx-golang/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/nginx-golang)
+
### NGINX proxy with Go backend
Project structure:
@@ -83,14 +90,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/nginx-golang
-```
diff --git a/official-documentation-samples/README.md b/official-documentation-samples/README.md
new file mode 100644
index 0000000..44d6559
--- /dev/null
+++ b/official-documentation-samples/README.md
@@ -0,0 +1,28 @@
+# Sample apps with Compose
+
+The following samples show the various aspects of how to work with Docker
+Compose. As a prerequisite, be sure to [install Docker Compose](https://docs.docker.com/compose/install/)
+if you have not already done so.
+
+## Key concepts these samples cover
+
+The samples should help you to:
+
+- define services based on Docker images using
+ [Compose files](https://docs.docker.com/compose/compose-file/) `docker-compose.yml` files
+- understand the relationship between `docker-compose.yml` and
+ [Dockerfiles](https://docs.docker.com/engine/reference/builder/)
+- learn how to make calls to your application services from Compose files
+
+## Samples tailored to demo Compose
+
+These samples focus specifically on Docker Compose:
+
+- [Quickstart: Compose and Django](./django/README.md) - Shows how to use Docker Compose to set up and run a simple Django/PostgreSQL app.
+
+- [Quickstart: Compose and Rails](./rails/README.md) - Shows how to use
+Docker Compose to set up and run a Rails/PostgreSQL app.
+
+- [Quickstart: Compose and WordPress](./wordpress/README.md) - Shows how to
+use Docker Compose to set up and run WordPress in an isolated environment
+with Docker containers.
diff --git a/official-documentation-samples/django/README.md b/official-documentation-samples/django/README.md
new file mode 100644
index 0000000..f7add9f
--- /dev/null
+++ b/official-documentation-samples/django/README.md
@@ -0,0 +1,286 @@
+# Quickstart: Compose and Django
+
+This quick-start guide demonstrates how to use Docker Compose to set up and run a simple Django/PostgreSQL app. Before starting,
+[install Compose](https://docs.docker.com/compose/install/).
+
+## Define the project components
+
+For this project, you need to create a Dockerfile, a Python dependencies file,
+and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extension for this file.)
+
+1. Create an empty project directory.
+
+ You can name the directory something easy for you to remember. This directory is the context for your application image. The directory should only contain resources to build that image.
+
+2. Create a new file called `Dockerfile` in your project directory.
+
+ The Dockerfile defines an application's image content via one or more build
+ commands that configure that image. Once built, you can run the image in a
+ container. For more information on `Dockerfile`, see the [Docker user guide](https://docs.docker.com/get-started/)
+ and the [Dockerfile reference](https://docs.docker.com/engine/reference/builder/).
+
+3. Add the following content to the `Dockerfile`.
+
+ ```dockerfile
+ # syntax=docker/dockerfile:1
+ FROM python:3
+ ENV PYTHONDONTWRITEBYTECODE=1
+ ENV PYTHONUNBUFFERED=1
+ WORKDIR /code
+ COPY requirements.txt /code/
+ RUN pip install -r requirements.txt
+ COPY . /code/
+ ```
+
+ This `Dockerfile` starts with a [Python 3 parent image](https://hub.docker.com/r/library/python/tags/3/).
+ The parent image is modified by adding a new `code` directory. The parent image is further modified
+ by installing the Python requirements defined in the `requirements.txt` file.
+
+4. Save and close the `Dockerfile`.
+
+5. Create a `requirements.txt` in your project directory.
+
+ This file is used by the `RUN pip install -r requirements.txt` command in your `Dockerfile`.
+
+6. Add the required software in the file.
+
+ ```python
+ Django>=3.0,<4.0
+ psycopg2>=2.8
+ ```
+
+7. Save and close the `requirements.txt` file.
+
+8. Create a file called `docker-compose.yml` in your project directory.
+
+ The `docker-compose.yml` file describes the services that make your app. In
+ this example those services are a web server and database. The compose file
+ also describes which Docker images these services use, how they link
+ together, any volumes they might need to be mounted inside the containers.
+ Finally, the `docker-compose.yml` file describes which ports these services
+ expose. See the [`docker-compose.yml` reference](https://docs.docker.com/compose/compose-file/) for more
+ information on how this file works.
+
+9. Add the following configuration to the file.
+
+ ```yaml
+ services:
+ db:
+ image: postgres
+ volumes:
+ - ./data/db:/var/lib/postgresql/data
+ environment:
+ - POSTGRES_DB=postgres
+ - POSTGRES_USER=postgres
+ - POSTGRES_PASSWORD=postgres
+ web:
+ build: .
+ command: python manage.py runserver 0.0.0.0:8000
+ volumes:
+ - .:/code
+ ports:
+ - "8000:8000"
+ environment:
+ - POSTGRES_NAME=postgres
+ - POSTGRES_USER=postgres
+ - POSTGRES_PASSWORD=postgres
+ depends_on:
+ - db
+ ```
+
+ This file defines two services: The `db` service and the `web` service.
+
+ > Note:
+ >
+ > This uses the build in development server to run your application
+ > on port 8000. Do not use this in a production environment. For more
+ > information, see [Django documentation](https://docs.djangoproject.com/en/3.1/intro/tutorial01/#the-development-server){: target="_blank" rel="noopener" class="_”}.
+
+10. Save and close the `docker-compose.yml` file.
+
+## Create a Django project
+
+In this step, you create a Django starter project by building the image from the build context defined in the previous procedure.
+
+1. Change to the root of your project directory.
+
+2. Create the Django project by running the [docker compose run](https://docs.docker.com/engine/reference/commandline/compose_run/)
+ command as follows.
+
+ ```console
+ sudo docker compose run web django-admin startproject composeexample .
+ ```
+
+ This instructs Compose to run `django-admin startproject composeexample`
+ in a container, using the `web` service's image and configuration. Because
+ the `web` image doesn't exist yet, Compose builds it from the current
+ directory, as specified by the `build: .` line in `docker-compose.yml`.
+
+ Once the `web` service image is built, Compose runs it and executes the
+ `django-admin startproject` command in the container. This command
+ instructs Django to create a set of files and directories representing a
+ Django project.
+
+3. After the `docker compose` command completes, list the contents of your project.
+
+ ```console
+ $ ls -l
+
+ drwxr-xr-x 2 root root composeexample
+ drwxr-xr-x 3 root root data
+ -rw-rw-r-- 1 user user docker-compose.yml
+ -rw-rw-r-- 1 user user Dockerfile
+ -rwxr-xr-x 1 root root manage.py
+ -rw-rw-r-- 1 user user requirements.txt
+ ```
+
+ If you are running Docker on Linux, the files `django-admin` created are
+ owned by root. This happens because the container runs as the root user.
+ Change the ownership of the new files.
+
+ Do not change the permission of the data folder where Postgres has its file, otherwise Postgres will not be able to start due to permission issues.
+
+ ```console
+ sudo chown -R $USER:$USER composeexample manage.py
+ ```
+
+ If you are running Docker on Mac or Windows, you should already
+ have ownership of all files, including those generated by
+ `django-admin`. List the files just to verify this.
+
+ ```console
+ $ ls -l
+
+ total 32
+ -rw-r--r-- 1 user staff 145 Feb 13 23:00 Dockerfile
+ drwxr-xr-x 6 user staff 204 Feb 13 23:07 composeexample
+ -rw-r--r-- 1 user staff 159 Feb 13 23:02 docker-compose.yml
+ -rwxr-xr-x 1 user staff 257 Feb 13 23:07 manage.py
+ -rw-r--r-- 1 user staff 16 Feb 13 23:01 requirements.txt
+ ```
+
+### Connect the database
+
+In this section, you set up the database connection for Django.
+
+1. In your project directory, edit the `composeexample/settings.py` file.
+
+2. Replace the `DATABASES = ...` with the following:
+
+ ```python
+ # settings.py
+
+ import os
+
+ [...]
+
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.postgresql',
+ 'NAME': os.environ.get('POSTGRES_NAME'),
+ 'USER': os.environ.get('POSTGRES_USER'),
+ 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'),
+ 'HOST': 'db',
+ 'PORT': 5432,
+ }
+ }
+ ```
+
+ These settings are determined by the
+ [postgres](https://hub.docker.com/_/postgres) Docker image
+ specified in `docker-compose.yml`.
+
+3. Save and close the file.
+
+4. Run the [docker compose up](https://docs.docker.com/engine/reference/commandline/compose_up/) command from the top level directory for your project.
+
+ ```console
+ $ docker compose up
+
+ djangosample_db_1 is up-to-date
+ Creating djangosample_web_1 ...
+ Creating djangosample_web_1 ... done
+ Attaching to djangosample_db_1, djangosample_web_1
+ db_1 | The files belonging to this database system will be owned by user "postgres".
+ db_1 | This user must also own the server process.
+ db_1 |
+ db_1 | The database cluster will be initialized with locale "en_US.utf8".
+ db_1 | The default database encoding has accordingly been set to "UTF8".
+ db_1 | The default text search configuration will be set to "english".
+
+ <...>
+
+ web_1 | July 30, 2020 - 18:35:38
+ web_1 | Django version 3.0.8, using settings 'composeexample.settings'
+ web_1 | Starting development server at http://0.0.0.0:8000/
+ web_1 | Quit the server with CONTROL-C.
+ ```
+
+ At this point, your Django app should be running at port `8000` on
+ your Docker host. On Docker Desktop for Mac and Docker Desktop for Windows, go
+ to `http://localhost:8000` on a web browser to see the Django
+ welcome page.
+
+ 
+
+ > Note:
+ >
+ > On certain platforms (Windows 10), you might need to edit `ALLOWED_HOSTS`
+ > inside `settings.py` and add your Docker host name or IP address to the list.
+ > For demo purposes, you can set the value to:
+ >
+ > ```python
+ > ALLOWED_HOSTS = ['*']
+ > ```
+ >
+ > This value is **not** safe for production usage. Refer to the
+ > [Django documentation](https://docs.djangoproject.com/en/1.11/ref/settings/#allowed-hosts) for more information.
+
+5. List running containers.
+
+ In another terminal window, list the running Docker processes with the `docker ps` or `docker container ls` command.
+
+ ```console
+ $ docker ps
+
+ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+ def85eff5f51 django_web "python3 manage.py..." 10 minutes ago Up 9 minutes 0.0.0.0:8000->8000/tcp django_web_1
+ 678ce61c79cc postgres "docker-entrypoint..." 20 minutes ago Up 9 minutes 5432/tcp django_db_1
+ ```
+
+6. Shut down services and clean up by using either of these methods:
+
+ * Stop the application by typing `Ctrl-C` in the same shell in where you
+ started it:
+
+ ```console
+ Gracefully stopping... (press Ctrl+C again to force)
+ Killing test_web_1 ... done
+ Killing test_db_1 ... done
+ ```
+
+ * Or, for a more elegant shutdown, switch to a different shell, and run
+ [docker compose down](https://docs.docker.com/engine/reference/commandline/compose_down/) from the top level of your
+ Django sample project directory.
+
+ ```console
+ $ docker compose down
+
+ Stopping django_web_1 ... done
+ Stopping django_db_1 ... done
+ Removing django_web_1 ... done
+ Removing django_web_run_1 ... done
+ Removing django_db_1 ... done
+ Removing network django_default
+ ```
+
+ Once you've shut down the app, you can safely remove the Django project directory (for example, `rm -rf django`).
+
+## More Compose documentation
+
+* [Docker Compose overview](https://docs.docker.com/compose/)
+* [Install Docker Compose](https://docs.docker.com/compose/install/)
+* [Getting Started with Docker Compose](https://docs.docker.com/compose/gettingstarted/)
+* [Docker Compose Command line reference](https://docs.docker.com/compose/reference/)
+* [Compose file reference](https://docs.docker.com/compose/compose-file/)
+* [Awesome Compose Django sample application](../../django/README.md)
diff --git a/official-documentation-samples/django/images/django-it-worked.png b/official-documentation-samples/django/images/django-it-worked.png
new file mode 100644
index 0000000..a96a3b0
Binary files /dev/null and b/official-documentation-samples/django/images/django-it-worked.png differ
diff --git a/official-documentation-samples/rails/README.md b/official-documentation-samples/rails/README.md
new file mode 100644
index 0000000..52e8dab
--- /dev/null
+++ b/official-documentation-samples/rails/README.md
@@ -0,0 +1,272 @@
+# Quickstart: Compose and Rails
+
+This Quickstart guide shows you how to use Docker Compose to set up and run
+a Rails/PostgreSQL app. Before starting, [install Compose](https://docs.docker.com/compose/install/).
+
+## Define the project
+
+Start by setting up the files needed to build the app. The app will run inside a
+Docker container containing its dependencies. Defining dependencies is done using
+a file called `Dockerfile`. To begin with, the Dockerfile consists of:
+
+```dockerfile
+# syntax=docker/dockerfile:1
+FROM ruby:2.5
+RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
+WORKDIR /myapp
+COPY Gemfile /myapp/Gemfile
+COPY Gemfile.lock /myapp/Gemfile.lock
+RUN bundle install
+
+# Add a script to be executed every time the container starts.
+COPY entrypoint.sh /usr/bin/
+RUN chmod +x /usr/bin/entrypoint.sh
+ENTRYPOINT ["entrypoint.sh"]
+EXPOSE 3000
+
+# Configure the main process to run when running the image
+CMD ["rails", "server", "-b", "0.0.0.0"]
+```
+
+That'll put your application code inside an image that builds a container
+with Ruby, Bundler and all your dependencies inside it. For more information on
+how to write Dockerfiles, see the [Docker user guide](https://docs.docker.com/get-started/)
+and the [Dockerfile reference](https://docs.docker.com/engine/reference/builder/).
+
+Next, open an editor and create a bootstrap `Gemfile` which just loads Rails. This will be overwritten in a moment by `rails new`.
+
+```ruby
+source 'https://rubygems.org'
+gem 'rails', '~>5'
+```
+
+Create an empty `Gemfile.lock` file to build our `Dockerfile`.
+
+```console
+$ touch Gemfile.lock
+```
+
+Next, provide an entrypoint script to fix a Rails-specific issue that
+prevents the server from restarting when a certain `server.pid` file pre-exists.
+This script will be executed every time the container gets started.
+`entrypoint.sh` consists of:
+
+```bash
+#!/bin/bash
+set -e
+
+# Remove a potentially pre-existing server.pid for Rails.
+rm -f /myapp/tmp/pids/server.pid
+
+# Then exec the container's main process (what's set as CMD in the Dockerfile).
+exec "$@"
+```
+
+Finally, `docker-compose.yml` is where the magic happens. This file describes
+the services that comprise your app (a database and a web app), how to get each
+one's Docker image (the database just runs on a pre-made PostgreSQL image, and
+the web app is built from the current directory), and the configuration needed
+to link them together and expose the web app's port.
+
+```yaml
+services:
+ db:
+ image: postgres
+ volumes:
+ - ./tmp/db:/var/lib/postgresql/data
+ environment:
+ POSTGRES_PASSWORD: password
+ web:
+ build: .
+ command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
+ volumes:
+ - .:/myapp
+ ports:
+ - "3000:3000"
+ depends_on:
+ - db
+```
+
+> **Tip**
+>
+> You can use either a `.yml` or `.yaml` extension for this file.
+
+### Build the project
+
+With those files in place, you can now generate the Rails skeleton app
+using [docker compose run](https://docs.docker.com/engine/reference/commandline/compose_run/):
+
+```console
+$ docker compose run --no-deps web rails new . --force --database=postgresql
+```
+
+First, Compose builds the image for the `web` service using the `Dockerfile`.
+The `--no-deps` tells Compose not to start linked services. Then it runs
+`rails new` inside a new container, using that image. Once it's done, you
+should have generated a fresh app.
+
+List the files.
+
+```console
+$ ls -l
+
+total 64
+-rw-r--r-- 1 vmb staff 222 Jun 7 12:05 Dockerfile
+-rw-r--r-- 1 vmb staff 1738 Jun 7 12:09 Gemfile
+-rw-r--r-- 1 vmb staff 4297 Jun 7 12:09 Gemfile.lock
+-rw-r--r-- 1 vmb staff 374 Jun 7 12:09 README.md
+-rw-r--r-- 1 vmb staff 227 Jun 7 12:09 Rakefile
+drwxr-xr-x 10 vmb staff 340 Jun 7 12:09 app
+drwxr-xr-x 8 vmb staff 272 Jun 7 12:09 bin
+drwxr-xr-x 14 vmb staff 476 Jun 7 12:09 config
+-rw-r--r-- 1 vmb staff 130 Jun 7 12:09 config.ru
+drwxr-xr-x 3 vmb staff 102 Jun 7 12:09 db
+-rw-r--r-- 1 vmb staff 211 Jun 7 12:06 docker-compose.yml
+-rw-r--r-- 1 vmb staff 184 Jun 7 12:08 entrypoint.sh
+drwxr-xr-x 4 vmb staff 136 Jun 7 12:09 lib
+drwxr-xr-x 3 vmb staff 102 Jun 7 12:09 log
+-rw-r--r-- 1 vmb staff 63 Jun 7 12:09 package.json
+drwxr-xr-x 9 vmb staff 306 Jun 7 12:09 public
+drwxr-xr-x 9 vmb staff 306 Jun 7 12:09 test
+drwxr-xr-x 4 vmb staff 136 Jun 7 12:09 tmp
+drwxr-xr-x 3 vmb staff 102 Jun 7 12:09 vendor
+```
+
+If you are running Docker on Linux, the files `rails new` created are owned by
+root. This happens because the container runs as the root user. If this is the
+case, change the ownership of the new files.
+
+```console
+$ sudo chown -R $USER:$USER .
+```
+
+If you are running Docker on Mac or Windows, you should already have ownership
+of all files, including those generated by `rails new`.
+
+Now that you’ve got a new Gemfile, you need to build the image again. (This, and
+changes to the `Gemfile` or the Dockerfile, should be the only times you’ll need
+to rebuild.)
+
+```console
+$ docker compose build
+```
+
+### Connect the database
+
+The app is now bootable, but you're not quite there yet. By default, Rails
+expects a database to be running on `localhost` - so you need to point it at the
+`db` container instead. You also need to change the database and username to
+align with the defaults set by the `postgres` image.
+
+Replace the contents of `config/database.yml` with the following:
+
+```yaml
+default: &default
+ adapter: postgresql
+ encoding: unicode
+ host: db
+ username: postgres
+ password: password
+ pool: 5
+
+development:
+ <<: *default
+ database: myapp_development
+
+
+test:
+ <<: *default
+ database: myapp_test
+```
+
+You can now boot the app with [docker compose up](https://docs.docker.com/engine/reference/commandline/compose_up/).
+If all is well, you should see some PostgreSQL output:
+
+```console
+$ docker compose up
+
+rails_db_1 is up-to-date
+Creating rails_web_1 ... done
+Attaching to rails_db_1, rails_web_1
+db_1 | PostgreSQL init process complete; ready for start up.
+db_1 |
+db_1 | 2018-03-21 20:18:37.437 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
+db_1 | 2018-03-21 20:18:37.437 UTC [1] LOG: listening on IPv6 address "::", port 5432
+db_1 | 2018-03-21 20:18:37.443 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
+db_1 | 2018-03-21 20:18:37.726 UTC [55] LOG: database system was shut down at 2018-03-21 20:18:37 UTC
+db_1 | 2018-03-21 20:18:37.772 UTC [1] LOG: database system is ready to accept connections
+```
+
+Finally, you need to create the database. In another terminal, run:
+
+```console
+$ docker compose run web rake db:create
+Starting rails_db_1 ... done
+Created database 'myapp_development'
+Created database 'myapp_test'
+```
+
+### View the Rails welcome page!
+
+That's it. Your app should now be running on port 3000 on your Docker daemon.
+
+On Docker Desktop for Mac and Docker Desktop for Windows, go to `http://localhost:3000` on a web
+browser to see the Rails Welcome.
+
+
+
+### Stop the application
+
+To stop the application, run [docker compose down](https://docs.docker.com/engine/reference/commandline/compose_down/) in
+your project directory. You can use the same terminal window in which you
+started the database, or another one where you have access to a command prompt.
+This is a clean way to stop the application.
+
+```console
+$ docker compose down
+
+Stopping rails_web_1 ... done
+Stopping rails_db_1 ... done
+Removing rails_web_run_1 ... done
+Removing rails_web_1 ... done
+Removing rails_db_1 ... done
+Removing network rails_default
+
+```
+
+### Restart the application
+
+To restart the application run `docker compose up` in the project directory.
+
+### Rebuild the application
+
+If you make changes to the Gemfile or the Compose file to try out some different
+configurations, you need to rebuild. Some changes require only
+`docker compose up --build`, but a full rebuild requires a re-run of
+`docker compose run web bundle install` to sync changes in the `Gemfile.lock` to
+the host, followed by `docker compose up --build`.
+
+Here is an example of the first case, where a full rebuild is not necessary.
+Suppose you simply want to change the exposed port on the local host from `3000`
+in our first example to `3001`. Make the change to the Compose file to expose
+port `3000` on the container through a new port, `3001`, on the host, and save
+the changes:
+
+```yaml
+ports:
+ - "3001:3000"
+```
+
+Now, rebuild and restart the app with `docker compose up --build`.
+
+Inside the container, your app is running on the same port as before `3000`, but
+the Rails Welcome is now available on `http://localhost:3001` on your local
+host.
+
+## More Compose documentation
+
+* [Docker Compose overview](https://docs.docker.com/compose/)
+* [Install Docker Compose](https://docs.docker.com/compose/install/)
+* [Getting Started with Docker Compose](https://docs.docker.com/compose/gettingstarted/)
+* [Docker Compose Command line reference](https://docs.docker.com/compose/reference/)
+* [Compose file reference](https://docs.docker.com/compose/compose-file/)
diff --git a/official-documentation-samples/rails/images/rails-welcome.png b/official-documentation-samples/rails/images/rails-welcome.png
new file mode 100644
index 0000000..c836307
Binary files /dev/null and b/official-documentation-samples/rails/images/rails-welcome.png differ
diff --git a/official-documentation-samples/wordpress/README.md b/official-documentation-samples/wordpress/README.md
new file mode 100644
index 0000000..20623c9
--- /dev/null
+++ b/official-documentation-samples/wordpress/README.md
@@ -0,0 +1,147 @@
+# Quickstart: Compose and WordPress
+
+You can use Docker Compose to easily run WordPress in an isolated environment
+built with Docker containers. This quick-start guide demonstrates how to use
+Compose to set up and run WordPress. Before starting, make sure you have
+[Compose installed](https://docs.docker.com/compose/install/).
+
+## Define the project
+
+1. Create an empty project directory.
+
+ You can name the directory something easy for you to remember.
+ This directory is the context for your application image. The
+ directory should only contain resources to build that image.
+
+ This project directory contains a `docker-compose.yml` file which
+ is complete in itself for a good starter wordpress project.
+
+ >**Tip**: You can use either a `.yml` or `.yaml` extension for
+ this file. They both work.
+
+2. Change into your project directory.
+
+ For example, if you named your directory `my_wordpress`:
+
+ ```console
+ $ cd my_wordpress/
+ ```
+
+3. Create a `docker-compose.yml` file that starts your
+ `WordPress` blog and a separate `MySQL` instance with volume
+ mounts for data persistence:
+
+ ```yaml
+ services:
+ db:
+ # We use a mariadb image which supports both amd64 & arm64 architecture
+ image: mariadb:10.6.4-focal
+ # If you really want to use MySQL, uncomment the following line
+ #image: mysql:8.0.27
+ command: '--default-authentication-plugin=mysql_native_password'
+ volumes:
+ - db_data:/var/lib/mysql
+ restart: always
+ environment:
+ - MYSQL_ROOT_PASSWORD=somewordpress
+ - MYSQL_DATABASE=wordpress
+ - MYSQL_USER=wordpress
+ - MYSQL_PASSWORD=wordpress
+ expose:
+ - 3306
+ - 33060
+ wordpress:
+ image: wordpress:latest
+ volumes:
+ - wp_data:/var/www/html
+ ports:
+ - 80:80
+ restart: always
+ environment:
+ - WORDPRESS_DB_HOST=db
+ - WORDPRESS_DB_USER=wordpress
+ - WORDPRESS_DB_PASSWORD=wordpress
+ - WORDPRESS_DB_NAME=wordpress
+ volumes:
+ db_data:
+ wp_data:
+ ```
+
+ > **Notes**:
+ >
+ * The docker volumes `db_data` and `wordpress_data` persists updates made by WordPress
+ to the database, as well as the installed themes and plugins. [Learn more about docker volumes](https://docs.docker.com/storage/volumes/)
+ >
+ * WordPress Multisite works only on ports `80` and `443`.
+ {: .note-vanilla}
+
+### Build the project
+
+Now, run `docker compose up -d` from your project directory.
+
+This runs [`docker compose up`](https://docs.docker.com/engine/reference/commandline/compose_up/) in detached mode, pulls
+the needed Docker images, and starts the wordpress and database containers, as shown in
+the example below.
+
+```console
+$ docker compose up -d
+
+Creating network "my_wordpress_default" with the default driver
+Pulling db (mysql:5.7)...
+5.7: Pulling from library/mysql
+efd26ecc9548: Pull complete
+a3ed95caeb02: Pull complete
+<...>
+Digest: sha256:34a0aca88e85f2efa5edff1cea77cf5d3147ad93545dbec99cfe705b03c520de
+Status: Downloaded newer image for mysql:5.7
+Pulling wordpress (wordpress:latest)...
+latest: Pulling from library/wordpress
+efd26ecc9548: Already exists
+a3ed95caeb02: Pull complete
+589a9d9a7c64: Pull complete
+<...>
+Digest: sha256:ed28506ae44d5def89075fd5c01456610cd6c64006addfe5210b8c675881aff6
+Status: Downloaded newer image for wordpress:latest
+Creating my_wordpress_db_1
+Creating my_wordpress_wordpress_1
+```
+
+> **Note**: WordPress Multisite works only on ports `80` and/or `443`.
+If you get an error message about binding `0.0.0.0` to port `80` or `443`
+(depending on which one you specified), it is likely that the port you
+configured for WordPress is already in use by another service.
+
+### Bring up WordPress in a web browser
+
+At this point, WordPress should be running on port `80` of your Docker Host,
+and you can complete the "famous five-minute installation" as a WordPress
+administrator.
+
+> **Note**: The WordPress site is not immediately available on port `80`
+because the containers are still being initialized and may take a couple of
+minutes before the first load.
+
+If you are using Docker Desktop for Mac or Docker Desktop for Windows, you can use
+`http://localhost` as the IP address, and open `http://localhost:80` in a web
+browser.
+
+
+
+
+
+### Shutdown and cleanup
+
+The command [`docker compose down`](https://docs.docker.com/engine/reference/commandline/compose_down/) removes the
+containers and default network, but preserves your WordPress database.
+
+The command `docker compose down --volumes` removes the containers, default
+network, and the WordPress database.
+
+## More Compose documentation
+
+* [Docker Compose overview](https://docs.docker.com/compose/)
+* [Install Docker Compose](https://docs.docker.com/compose/install/)
+* [Getting Started with Docker Compose](https://docs.docker.com/compose/gettingstarted/)
+* [Docker Compose Command line reference](https://docs.docker.com/compose/reference/)
+* [Compose file reference](https://docs.docker.com/compose/compose-file/)
+* [Awesome Compose WordPress sample](../../wordpress-mysql/README.md)
diff --git a/official-documentation-samples/wordpress/images/wordpress-lang.png b/official-documentation-samples/wordpress/images/wordpress-lang.png
new file mode 100644
index 0000000..a19eca9
Binary files /dev/null and b/official-documentation-samples/wordpress/images/wordpress-lang.png differ
diff --git a/official-documentation-samples/wordpress/images/wordpress-welcome.png b/official-documentation-samples/wordpress/images/wordpress-welcome.png
new file mode 100644
index 0000000..4046eb8
Binary files /dev/null and b/official-documentation-samples/wordpress/images/wordpress-welcome.png differ
diff --git a/open_in_new.svg b/open_in_new.svg
new file mode 100644
index 0000000..112ff73
--- /dev/null
+++ b/open_in_new.svg
@@ -0,0 +1,8 @@
+
diff --git a/pihole-cloudflared-DoH/README.md b/pihole-cloudflared-DoH/README.md
index 2575855..02610d6 100644
--- a/pihole-cloudflared-DoH/README.md
+++ b/pihole-cloudflared-DoH/README.md
@@ -39,7 +39,7 @@ Before deploying this setup, you need to configure the following values in the [
- PIHOLE_PW (admin password)
- PIHOLE_ROUTER_IP (only needed for activated conditional forwarding)
- PIHOLE_NETWORK_DOMAIN (only needed for activated conditional forwarding)
-- PIHOLE_HOST_IP (IPv4 address of your Pi-hole - needs to by static)
+- PIHOLE_HOST_IP (IPv4 address of your Pi-hole - needs to be static)
- PIHOLE_HOST_IPV6 (IPv6 address of your Pi-hole - can be empty if you only use IPv4)
### Conditional forwarding (optional, default: enabled)
@@ -101,7 +101,7 @@ $ docker compose down -v
```
If you created an empty file, you may also check the ownership to prevent permission problems.
-### - Installing on Ubuntu may conflict with `systemd-resolved` - see [Installing on Ubuntu](https://github.com/pi-hole/docker-pi-hole#installing-on-ubuntu) for help.
+### - Installing on Ubuntu may conflict with `systemd-resolved` - see [Installing on Ubuntu](https://github.com/pi-hole/docker-pi-hole#installing-on-ubuntu-or-fedora) for help.
### - Environment variables are version-dependent
Environment variables like "CONDIIONAL_FORWARDING*" and "DNS1" are deprecated and replaced by e.g. "REV_SERVER*" and "PIHOLE_DNS" in version 5.8+.
diff --git a/postgresql-pgadmin/compose.yaml b/postgresql-pgadmin/compose.yaml
index e199ed3..c212e34 100644
--- a/postgresql-pgadmin/compose.yaml
+++ b/postgresql-pgadmin/compose.yaml
@@ -5,7 +5,7 @@ services:
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PW}
- - POSTGRES_DB=${POSTGRES_DB} #optional (specify default database instead of $POSTGRES_USER)
+ - POSTGRES_DB=${POSTGRES_DB} #optional (specify default database instead of $POSTGRES_DB)
ports:
- "5432:5432"
restart: always
diff --git a/react-express-mongodb/.docker/docker-compose.yaml b/react-express-mongodb/.docker/docker-compose.yaml
index 0adf162..05114d7 100644
--- a/react-express-mongodb/.docker/docker-compose.yaml
+++ b/react-express-mongodb/.docker/docker-compose.yaml
@@ -29,7 +29,6 @@ services:
expose:
- 3000
mongo:
- container_name: mongo
restart: always
image: mongo:4.2.0
volumes:
diff --git a/react-express-mongodb/README.md b/react-express-mongodb/README.md
index 2f896e7..69873cc 100644
--- a/react-express-mongodb/README.md
+++ b/react-express-mongodb/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/react-express-mongodb)
+
### React application with a NodeJS backend and a MongoDB database
Project structure:
@@ -132,14 +139,3 @@ __Explanation of service mongo__
:key: `If you wish to check your DB changes on your local machine as well. You should have installed MongoDB locally, otherwise you can't access your mongodb service of container from host machine.`
:white_check_mark: You should check your __mongo__ version is same as used in image. You can see the version of __mongo__ image in `docker-compose `file, I used __image: mongo:4.2.0__. If your mongo db version on your machine is not same then furst you have to updated your local __mongo__ version in order to works correctly.
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/react-express-mongodb
-```
diff --git a/react-express-mongodb/compose.yaml b/react-express-mongodb/compose.yaml
index 7c591fb..2b24de8 100644
--- a/react-express-mongodb/compose.yaml
+++ b/react-express-mongodb/compose.yaml
@@ -9,7 +9,6 @@ services:
volumes:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
- container_name: frontend
restart: always
networks:
- react-express
@@ -17,7 +16,6 @@ services:
- backend
backend:
- container_name: backend
restart: always
build:
context: backend
@@ -33,11 +31,10 @@ services:
expose:
- 3000
mongo:
- container_name: mongo
restart: always
image: mongo:4.2.0
volumes:
- - ./data:/data/db
+ - mongo_data:/data/db
networks:
- express-mongo
expose:
@@ -45,3 +42,6 @@ services:
networks:
react-express:
express-mongo:
+
+volumes:
+ mongo_data:
diff --git a/react-express-mysql/README.md b/react-express-mysql/README.md
index 2f87ab2..46c4e4c 100644
--- a/react-express-mysql/README.md
+++ b/react-express-mysql/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/react-express-mysql)
+
### React application with a NodeJS backend and a MySQL database
Project structure:
@@ -97,14 +104,3 @@ Removing react-express-mysql_db_1 ... done
Removing network react-express-mysql_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/react-express-mysql
-```
diff --git a/react-java-mysql/README.md b/react-java-mysql/README.md
index 741166a..94972d6 100644
--- a/react-java-mysql/README.md
+++ b/react-java-mysql/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/react-java-mysql)
+
### React application with a Spring backend and a MySQL database
Project structure:
@@ -35,27 +42,27 @@ services:
...
```
The compose file defines an application with three services `frontend`, `backend` and `db`.
-When deploying the application, docker compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
+When deploying the application, docker compose maps port 3000 of the frontend service container to port 3000 of the host as specified in the file.
Make sure port 3000 on the host is not already being in use.
-> ℹ️ **_INFO_**
-> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
-> You still can use the MySQL image by uncommenting the following line in the Compose file
+> ℹ️ **_INFO_**
+> For compatibility purpose between `AMD64` and `ARM64` architecture, we use a MariaDB as database instead of MySQL.
+> You still can use the MySQL image by uncommenting the following line in the Compose file
> `#image: mysql:8.0.27`
## Deploy with docker compose
```
$ docker compose up -d
-Creating network "react-java-mysql_default" with the default driver
+Creating network "react-java-mysql-default" with the default driver
Building backend
Step 1/17 : FROM maven:3.6.3-jdk-11 AS builder
...
Successfully tagged react-java-mysql_frontend:latest
WARNING: Image for service frontend was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
-Creating react-java-mysql_frontend_1 ... done
-Creating react-java-mysql_db_1 ... done
-Creating react-java-mysql_backend_1 ... done
+Creating react-java-mysql-frontend-1 ... done
+Creating react-java-mysql-db-1 ... done
+Creating react-java-mysql-backend-1 ... done
```
## Expected result
@@ -64,9 +71,9 @@ Listing containers must show three containers running and the port mapping as be
```
$ docker ps
ONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-a63dee74d79e react-java-mysql_backend "java -Djava.securit…" 39 seconds ago Up 37 seconds react-java-mysql_backend_1
-6a7364c0812e react-java-mysql_frontend "docker-entrypoint.s…" 39 seconds ago Up 33 seconds 0.0.0.0:3000->3000/tcp react-java-mysql_frontend_1
-b176b18fbec4 mysql:8.0.19 "docker-entrypoint.s…" 39 seconds ago Up 37 seconds 3306/tcp, 33060/tcp react-java-mysql_db_1
+a63dee74d79e react-java-mysql-backend "java -Djava.securit…" 39 seconds ago Up 37 seconds react-java-mysql_backend-1
+6a7364c0812e react-java-mysql-frontend "docker-entrypoint.s…" 39 seconds ago Up 33 seconds 0.0.0.0:3000->3000/tcp react-java-mysql_frontend-1
+b176b18fbec4 mysql:8.0.19 "docker-entrypoint.s…" 39 seconds ago Up 37 seconds 3306/tcp, 33060/tcp react-java-mysql_db-1
```
After the application starts, navigate to `http://localhost:3000` in your web browser to get a colorful message.
@@ -75,19 +82,11 @@ After the application starts, navigate to `http://localhost:3000` in your web br
Stop and remove the containers
```
$ docker compose down
-Stopping react-java-mysql_backend_1 ... done
-Stopping react-java-mysql_frontend_1 ... done
-Stopping react-java-mysql_db_1 ... done
-Removing react-java-mysql_backend_1 ... done
-Removing react-java-mysql_frontend_1 ... done
-Removing react-java-mysql_db_1 ... done
-Removing network react-java-mysql_default
+Stopping react-java-mysql-backend-1 ... done
+Stopping react-java-mysql-frontend-1 ... done
+Stopping react-java-mysql-db-1 ... done
+Removing react-java-mysql-backend-1 ... done
+Removing react-java-mysql-frontend-1 ... done
+Removing react-java-mysql-db-1 ... done
+Removing network react-java-mysql-default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly frontend or the backend services inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/react-java-mysql`
-
-
\ No newline at end of file
diff --git a/react-nginx/README.md b/react-nginx/README.md
index 784687d..7b7044a 100755
--- a/react-nginx/README.md
+++ b/react-nginx/README.md
@@ -1,5 +1,11 @@
## Compose sample application
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/react-nginx)
+
### An project deploy React Application with Nginx
Project structure:
@@ -86,14 +92,3 @@ Stopping frontend ... done
Removing frontend ... done
Removing network react-nginx_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-
-
-
-To develop directly on the services inside containers, use the HTTPS Git url of the sample:
-```
-https://github.com/docker/awesome-compose/tree/master/react-nginx
-```
\ No newline at end of file
diff --git a/react-rust-postgres/readme.md b/react-rust-postgres/readme.md
index de63685..298de80 100644
--- a/react-rust-postgres/readme.md
+++ b/react-rust-postgres/readme.md
@@ -1,5 +1,11 @@
## Compose sample application
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/react-rust-postgres)
+
### React application with a Rust backend and a Postgresql database
Project structure:
@@ -74,11 +80,3 @@ Removing react-rust-postgres_frontend_1 ... done
Removing react-rust-postgres_db_1 ... done
Removing network react-rust-postgres_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly frontend or the backend services inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/react-rust-postgres`
-
-
diff --git a/sparkjava-mysql/README.md b/sparkjava-mysql/README.md
index 1957049..893ea3e 100644
--- a/sparkjava-mysql/README.md
+++ b/sparkjava-mysql/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/sparkjava-mysql)
+
### Java Spark application with MySQL database
Project structure:
@@ -75,11 +82,3 @@ Removing sparkjava-mysql_backend_1 ... done
Removing sparkjava-mysql_db_1 ... done
Removing network sparkjava-mysql_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly frontend or the backend services inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/sparkjava-mysql`
-
-
\ No newline at end of file
diff --git a/sparkjava/README.md b/sparkjava/README.md
index a448233..83d9223 100644
--- a/sparkjava/README.md
+++ b/sparkjava/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/sparkjava)
+
### Spark Java
Project structure:
@@ -59,11 +66,3 @@ Stopping sparkjava_sparkjava_1 ... done
Removing sparkjava_sparkjava_1 ... done
Removing network sparkjava_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly sparkjava service inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/sparkjava`
-
-
diff --git a/spring-postgres/README.md b/spring-postgres/README.md
index e5b47d1..ca4e9cb 100644
--- a/spring-postgres/README.md
+++ b/spring-postgres/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/spring-postgres)
+
### Java application with Spring framework and a Postgres database
Project structure:
@@ -77,11 +84,3 @@ Removing spring-postgres_db_1 ... done
Removing spring-postgres_backend_1 ... done
Removing network spring-postgres_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly frontend or the backend services inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/spring-postgres`
-
-
diff --git a/spring-postgres/backend/Dockerfile b/spring-postgres/backend/Dockerfile
index 99b5bab..9ab1943 100755
--- a/spring-postgres/backend/Dockerfile
+++ b/spring-postgres/backend/Dockerfile
@@ -33,7 +33,7 @@ FROM eclipse-temurin:17-jre-focal
EXPOSE 8080
VOLUME /tmp
ARG DEPENDENCY=/workdir/server/target/dependency
-COPY --from=builder ${DEPENDENCY}/BOOT-INF/lib /app/lib
-COPY --from=builder ${DEPENDENCY}/META-INF /app/META-INF
-COPY --from=builder ${DEPENDENCY}/BOOT-INF/classes /app
-ENTRYPOINT ["java","-cp","app:app/lib/*","com.company.project.Application"]
\ No newline at end of file
+COPY --from=prepare-production ${DEPENDENCY}/BOOT-INF/lib /app/lib
+COPY --from=prepare-production ${DEPENDENCY}/META-INF /app/META-INF
+COPY --from=prepare-production ${DEPENDENCY}/BOOT-INF/classes /app
+ENTRYPOINT ["java","-cp","app:app/lib/*","com.company.project.Application"]
diff --git a/traefik-golang/README.md b/traefik-golang/README.md
index 55f20d1..7a86e75 100644
--- a/traefik-golang/README.md
+++ b/traefik-golang/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/traefik-golang)
+
### TRAEFIK proxy with GO backend
Project structure:
@@ -92,11 +99,3 @@ Stop and remove the containers
```
$ docker compose down
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly the backend service inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/traefik-golang`
-
-
diff --git a/vuejs/README.md b/vuejs/README.md
index fc4782e..1fd4d1d 100644
--- a/vuejs/README.md
+++ b/vuejs/README.md
@@ -1,4 +1,11 @@
## Compose sample application
+
+### Use with Docker Development Environments
+
+You can open this sample in the Dev Environments feature of Docker Desktop version 4.12 or later.
+
+[Open in Docker Dev Environments ](https://open.docker.com/dashboard/dev-envs?url=https://github.com/docker/awesome-compose/tree/master/vuejs)
+
### VueJS
Project structure:
@@ -59,11 +66,3 @@ Stopping vuejs_web_1 ... done
Removing vuejs_web_1 ... done
Removing network vuejs_default
```
-
-## Use with Docker Development Environments
-
-You can use this sample with the Dev Environments feature of Docker Desktop.
-To develop directly web service inside containers, you just need to use the https git url of the sample:
-`https://github.com/docker/awesome-compose/tree/master/vuejs`
-
-
diff --git a/wasmedge-kafka-mysql/.docker/docker-compose.yml b/wasmedge-kafka-mysql/.docker/docker-compose.yml
new file mode 100644
index 0000000..6163108
--- /dev/null
+++ b/wasmedge-kafka-mysql/.docker/docker-compose.yml
@@ -0,0 +1,36 @@
+services:
+ redpanda:
+ image: docker.redpanda.com/vectorized/redpanda:v22.2.2
+ command:
+ - redpanda start
+ - --smp 1
+ - --overprovisioned
+ - --node-id 0
+ - --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
+ - --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://redpanda:9092
+ - --pandaproxy-addr 0.0.0.0:8082
+ - --advertise-pandaproxy-addr localhost:8082
+ ports:
+ - 8081:8081
+ - 8082:8082
+ - 9092:9092
+ - 9644:9644
+ - 29092:29092
+ volumes:
+ - ./kafka:/app
+ etl:
+ image: etl-kafka
+ platform: wasi/wasm
+ build:
+ context: etl
+ environment:
+ DATABASE_URL: mysql://root:whalehello@db:3306/mysql
+ KAFKA_URL: kafka://redpanda:9092/order
+ RUST_BACKTRACE: full
+ RUST_LOG: info
+ restart: unless-stopped
+ runtime: io.containerd.wasmedge.v1
+ db:
+ image: mariadb:10.9
+ environment:
+ MYSQL_ROOT_PASSWORD: whalehello
diff --git a/wasmedge-kafka-mysql/README.md b/wasmedge-kafka-mysql/README.md
new file mode 100644
index 0000000..1efd5d7
--- /dev/null
+++ b/wasmedge-kafka-mysql/README.md
@@ -0,0 +1,117 @@
+# Compose sample application
+
+
+
+This sample demonstrates a WebAssembly (Wasm) microservice written in Rust. It subscribes to a Kafka queue topic on a Redpanda server, and then transforms and saves each message into a MySQL (MariaDB) database table. The microservice is compiled into Wasm and runs in the WasmEdge runtime, which is a secure and lightweight alternative to natively compiled Rust apps in Linux containers.
+
+## Use with Docker Development Environments
+
+You will need a version of Docker Desktop or Docker CLI with Wasm support.
+
+* [Install Docker Desktop + Wasm (Beta)](https://docs.docker.com/desktop/wasm/)
+* [Install Docker CLI + Wasm](https://github.com/chris-crone/wasm-day-na-22/tree/main/server)
+
+## WasmEdge server with Redpanda and MySQL database
+
+Project structure:
+
+```
+.
++-- compose.yml
+|-- etl
+ |-- Dockerfile
+ |-- Cargo.toml
+ +-- src
+ |-- main.rs
+|-- kafka
+ |-- order.json
+|-- db
+ |-- db-password.txt
+```
+
+The [compose.yml](compose.yml) is as follows.
+
+```yaml
+services:
+ redpanda:
+ image: docker.redpanda.com/vectorized/redpanda:v22.2.2
+ command:
+ - redpanda start
+ - --smp 1
+ - --overprovisioned
+ - --node-id 0
+ - --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
+ - --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://redpanda:9092
+ - --pandaproxy-addr 0.0.0.0:8082
+ - --advertise-pandaproxy-addr localhost:8082
+ ports:
+ - 8081:8081
+ - 8082:8082
+ - 9092:9092
+ - 9644:9644
+ - 29092:29092
+ volumes:
+ - ./kafka:/app
+
+ etl:
+ image: etl-kafka
+ build:
+ context: etl
+ platforms:
+ - wasi/wasm32
+ environment:
+ DATABASE_URL: mysql://root:whalehello@db:3306/mysql
+ KAFKA_URL: kafka://redpanda:9092/order
+ RUST_BACKTRACE: full
+ RUST_LOG: info
+ restart: unless-stopped
+ runtime: io.containerd.wasmedge.v1
+
+ db:
+ image: mariadb:10.9
+ environment:
+ MYSQL_ROOT_PASSWORD: whalehello
+```
+
+The compose file defines an application with three services `redpanda`, `etl` and `db`. The `redpanda` service is a Kafka-compatible messaging server that produces messages in a queue topic. The `etl` service, in the WasmEdge container that subscribes to the queue topic and receives incoming messages. Each incoming message is parsed and stored in the `db` MySQL (MariaDB) database server.
+
+## Deploy with docker compose
+
+```bash
+$ docker compose up -d
+...
+ ⠿ Network wasmedge-kafka-mysql_default Created 0.1s
+ ⠿ Container wasmedge-kafka-mysql-redpanda-1 Created 0.3s
+ ⠿ Container wasmedge-kafka-mysql-etl-1 Created 0.3s
+ ⠿ Container wasmedge-kafka-mysql-db-1 Created 0.3s
+```
+
+## Expected result
+
+```bash
+$ docker compose ps
+NAME COMMAND SERVICE STATUS PORTS
+wasmedge-kafka-mysql-db-1 "docker-entrypoint.s…" db running 3306/tcp
+wasmedge-kafka-mysql-etl-1 "kafka.wasm" etl running
+wasmedge-kafka-mysql-redpanda-1 "/entrypoint.sh 'red…" redpanda running 0.0.0.0:8081-8082->8081-8082/tcp, :::8081-8082->8081-8082/tcp, 0.0.0.0:9092->9092/tcp, :::9092->9092/tcp, 0.0.0.0:9644->9644/tcp, :::9644->9644/tcp, 0.0.0.0:29092->29092/tcp, :::29092->29092/tcp
+```
+
+After the application starts,
+log into the Redpanda container and send a message to the queue topic `order` as follows.
+
+```bash
+$ docker compose exec redpanda /bin/bash
+redpanda@1add2615774b:/$ cd /app
+redpanda@1add2615774b:/app$ cat order.json | rpk topic produce order
+Produced to partition 0 at offset 0 with timestamp 1667922788523.
+```
+
+To see the data in the database container, you can use the following commands.
+
+```bash
+$ docker compose exec db /bin/bash
+root@c97c472db02e:/# mysql -u root -pwhalehello mysql
+mysql> select * from orders;
+... ...
+```
+
diff --git a/wasmedge-kafka-mysql/compose.yml b/wasmedge-kafka-mysql/compose.yml
new file mode 100644
index 0000000..6163108
--- /dev/null
+++ b/wasmedge-kafka-mysql/compose.yml
@@ -0,0 +1,36 @@
+services:
+ redpanda:
+ image: docker.redpanda.com/vectorized/redpanda:v22.2.2
+ command:
+ - redpanda start
+ - --smp 1
+ - --overprovisioned
+ - --node-id 0
+ - --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
+ - --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://redpanda:9092
+ - --pandaproxy-addr 0.0.0.0:8082
+ - --advertise-pandaproxy-addr localhost:8082
+ ports:
+ - 8081:8081
+ - 8082:8082
+ - 9092:9092
+ - 9644:9644
+ - 29092:29092
+ volumes:
+ - ./kafka:/app
+ etl:
+ image: etl-kafka
+ platform: wasi/wasm
+ build:
+ context: etl
+ environment:
+ DATABASE_URL: mysql://root:whalehello@db:3306/mysql
+ KAFKA_URL: kafka://redpanda:9092/order
+ RUST_BACKTRACE: full
+ RUST_LOG: info
+ restart: unless-stopped
+ runtime: io.containerd.wasmedge.v1
+ db:
+ image: mariadb:10.9
+ environment:
+ MYSQL_ROOT_PASSWORD: whalehello
diff --git a/wasmedge-kafka-mysql/db/db-password.txt b/wasmedge-kafka-mysql/db/db-password.txt
new file mode 100644
index 0000000..21eee51
--- /dev/null
+++ b/wasmedge-kafka-mysql/db/db-password.txt
@@ -0,0 +1 @@
+whalehello
diff --git a/wasmedge-kafka-mysql/etl/Cargo.toml b/wasmedge-kafka-mysql/etl/Cargo.toml
new file mode 100644
index 0000000..657c1db
--- /dev/null
+++ b/wasmedge-kafka-mysql/etl/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "kafka"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+anyhow = "1.0.65"
+mega_etl = {git = "https://github.com/second-state/MEGA.git"}
+tokio_wasi = {version = '1.21', features = ["rt", "macros"]}
+env_logger = "0.9"
+log = "0.4"
+serde = { version = "1.0", features = ["derive"] }
+serde_json = "1.0"
+http_req_wasi = "0.10"
+lazy_static = "1.4.0"
diff --git a/wasmedge-kafka-mysql/etl/Dockerfile b/wasmedge-kafka-mysql/etl/Dockerfile
new file mode 100644
index 0000000..62df729
--- /dev/null
+++ b/wasmedge-kafka-mysql/etl/Dockerfile
@@ -0,0 +1,27 @@
+# syntax=docker/dockerfile:1
+FROM --platform=$BUILDPLATFORM rust:1.64 AS buildbase
+RUN <) -> TransformerResult> {
+ let s = std::str::from_utf8(&inbound_data)
+ .map_err(|e| TransformerError::Custom(e.to_string()))?;
+ let order: Order = serde_json::from_str(String::from(s).as_str())
+ .map_err(|e| TransformerError::Custom(e.to_string()))?;
+ log::info!("{:?}", &order);
+ let mut ret = vec![];
+ let sql_string = format!(
+ r"INSERT INTO orders VALUES ({:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, CURRENT_TIMESTAMP);",
+ order.order_id,
+ order.product_id,
+ order.quantity,
+ order.amount,
+ order.shipping,
+ order.tax,
+ order.shipping_address,
+ );
+ dbg!(sql_string.clone());
+ ret.push(sql_string);
+ Ok(ret)
+ }
+
+ async fn init() -> TransformerResult {
+ Ok(String::from(
+ r"CREATE TABLE IF NOT EXISTS orders (order_id INT, product_id INT, quantity INT, amount FLOAT, shipping FLOAT, tax FLOAT, shipping_address VARCHAR(50), date_registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP);",
+ ))
+ }
+}
+
+#[tokio::main(flavor = "current_thread")]
+async fn main() -> anyhow::Result<()> {
+ env_logger::init();
+
+ // can use builder later
+ let database_uri = std::env::var("DATABASE_URL")?;
+ let kafka_uri = std::env::var("KAFKA_URL")?;
+ let mut pipe = Pipe::new(database_uri, kafka_uri).await;
+
+ // This is async because this calls the async transform() function in Order
+ pipe.start::().await?;
+ Ok(())
+}
diff --git a/wasmedge-kafka-mysql/kafka/order.json b/wasmedge-kafka-mysql/kafka/order.json
new file mode 100644
index 0000000..aeb1a38
--- /dev/null
+++ b/wasmedge-kafka-mysql/kafka/order.json
@@ -0,0 +1 @@
+{"order_id": 1,"product_id": 12,"quantity": 2,"amount": 56.0,"shipping": 15.0,"tax": 2.0,"shipping_address": "Mataderos 2312"}
diff --git a/wasmedge-mysql-nginx/.docker/docker-compose.yml b/wasmedge-mysql-nginx/.docker/docker-compose.yml
new file mode 100644
index 0000000..86559a8
--- /dev/null
+++ b/wasmedge-mysql-nginx/.docker/docker-compose.yml
@@ -0,0 +1,25 @@
+services:
+ frontend:
+ image: nginx:alpine
+ ports:
+ - 8090:80
+ volumes:
+ - ./frontend:/usr/share/nginx/html
+
+ backend:
+ image: demo-microservice
+ platform: wasi/wasm
+ build:
+ context: backend/
+ ports:
+ - 8080:8080
+ environment:
+ DATABASE_URL: mysql://root:whalehello@db:3306/mysql
+ RUST_BACKTRACE: full
+ restart: unless-stopped
+ runtime: io.containerd.wasmedge.v1
+
+ db:
+ image: mariadb:10.9
+ environment:
+ MYSQL_ROOT_PASSWORD: whalehello
diff --git a/wasmedge-mysql-nginx/README.md b/wasmedge-mysql-nginx/README.md
new file mode 100644
index 0000000..7396c6a
--- /dev/null
+++ b/wasmedge-mysql-nginx/README.md
@@ -0,0 +1,125 @@
+# Compose sample application
+
+
+
+This sample demonstrates a web application with a WebAssembly (Wasm) microservice, written in Rust. The Wasm microservice is an HTTP API connected to a MySQL (MariaDB) database. The API is invoked via from JavaScript in a web interface serving static HTML. The microservice is compiled into WebAssembly (Wasm) and runs in the WasmEdge Runtime, a secure and lightweight alternative to natively compiled Rust apps in Linux containers. Checkout [this article](https://blog.logrocket.com/rust-microservices-server-side-webassembly/) or [this video](https://www.youtube.com/watch?v=VSqMPFr7SEs) to learn how the Rust code in this microservice works.
+
+## Use with Docker Development Environments
+
+You will need a version of Docker Desktop or Docker CLI with Wasm support.
+
+* [Install Docker Desktop + Wasm (Beta)](https://docs.docker.com/desktop/wasm/)
+* [Install Docker CLI + Wasm](https://github.com/chris-crone/wasm-day-na-22/tree/main/server)
+
+## WasmEdge server with Nginx proxy and MySQL database
+
+Project structure:
+
+```
+.
++-- compose.yml
+|-- backend
+ +-- Dockerfile
+ |-- Cargo.toml
+ |-- src
+ +-- main.rs
+|-- frontend
+ +-- index.html
+ |-- js
+ +-- app.js
+|-- db
+ +-- orders.json
+ |-- update_order.json
+```
+
+The [compose.yml](compose.yml) file:
+
+```yaml
+services:
+ frontend:
+ image: nginx:alpine
+ ports:
+ - 8090:80
+ volumes:
+ - ./frontend:/usr/share/nginx/html
+
+ backend:
+ image: demo-microservice
+ build:
+ context: backend/
+ platforms:
+ - wasi/wasm32
+ ports:
+ - 8080:8080
+ environment:
+ DATABASE_URL: mysql://root:whalehello@db:3306/mysql
+ RUST_BACKTRACE: full
+ restart: unless-stopped
+ runtime: io.containerd.wasmedge.v1
+
+ db:
+ image: mariadb:10.9
+ environment:
+ MYSQL_ROOT_PASSWORD: whalehello
+```
+
+The compose file defines an application with three services `frontend`, `backend` and `db`. The `frontend` is a simple Nginx server that hosts static web pages that access the `backend` web service, in the WasmEdge container, via HTTP port 8080. When deploying the application, docker compose maps port 8090 of the `frontend` service container to port 8090 of the host as specified in the file. Make sure that ports 8090 and 8080 on the host are not already being used.
+
+## Deploy with docker compose
+
+```bash
+$ docker compose up -d
+...
+ ⠿ Network wasmedge-mysql-nginx_default Created
+ ⠿ Container wasmedge-mysql-nginx-db-1 Created
+ ⠿ Container wasmedge-mysql-nginx-frontend-1 Created
+ ⠿ Container wasmedge-mysql-nginx-backend-1 Created
+```
+
+## Expected result
+
+```bash
+$ docker compose ps
+NAME COMMAND SERVICE STATUS PORTS
+wasmedge-mysql-nginx-backend-1 "order_demo_service.…" backend running 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp
+wasmedge-mysql-nginx-db-1 "docker-entrypoint.s…" db running 3306/tcp
+wasmedge-mysql-nginx-frontend-1 "/docker-entrypoint.…" frontend running 0.0.0.0:8090->80/tcp, :::8090->80/tcp
+```
+
+After the application starts, go to `http://localhost:8090` in your web browser to display the web frontend.
+
+### Using the API with `curl`
+
+As an alternative to the web frontend, you can use `curl` to interact with the WasmEdge API directly (the `backend` service).
+
+When the WasmEdge web service receives a GET request to the `/init` endpoint, it would initialize the database with the `orders` table.
+
+```bash
+curl http://localhost:8080/init
+```
+
+When the WasmEdge web service receives a POST request to the `/create_order` endpoint, it extracts the JSON data from the POST body and inserts an `Order` record into the database table.
+To insert multiple records, use the `/create_orders` endpoint and POST a JSON array of `Order` objects:
+
+```bash
+curl http://localhost:8080/create_orders -X POST -d @db/orders.json
+```
+
+When the WasmEdge web service receives a GET request to the `/orders` endpoint, it gets all rows from the `orders` table and return the result set in a JSON array in the HTTP response.
+
+```bash
+curl http://localhost:8080/orders
+```
+
+When the WasmEdge web service receives a POST request to the `/update_order` endpoint, it extracts the JSON data from the POST body and update the `Order` record in the database table that matches the `order_id` in the input data.
+
+```bash
+curl http://localhost:8080/update_order -X POST -d @db/update_order.json
+```
+
+When the WasmEdge web service receives a GET request to the `/delete_order` endpoint, it deletes the row in the `orders` table that matches the `id` GET parameter.
+
+```bash
+curl http://localhost:8080/delete_order?id=2
+```
+
diff --git a/wasmedge-mysql-nginx/backend/Cargo.toml b/wasmedge-mysql-nginx/backend/Cargo.toml
new file mode 100644
index 0000000..406cf3f
--- /dev/null
+++ b/wasmedge-mysql-nginx/backend/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+name = "order_demo_service"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
+anyhow = "1.0"
+serde_json = "1.0"
+serde = { version = "1.0", features = ["derive"] }
+url = "2.3"
+mysql_async_wasi = "0.30"
+hyper_wasi = { version = "0.15", features = ["full"] }
+tokio_wasi = { version = "1", features = ["io-util", "fs", "net", "time", "rt", "macros"] }
diff --git a/wasmedge-mysql-nginx/backend/Dockerfile b/wasmedge-mysql-nginx/backend/Dockerfile
new file mode 100644
index 0000000..17652e9
--- /dev/null
+++ b/wasmedge-mysql-nginx/backend/Dockerfile
@@ -0,0 +1,29 @@
+# syntax=docker/dockerfile:1
+
+FROM --platform=$BUILDPLATFORM rust:1.64 AS buildbase
+WORKDIR /src
+RUN < String {
+ if let Ok(url) = std::env::var("DATABASE_URL") {
+ let opts = Opts::from_url(&url).expect("DATABASE_URL invalid");
+ if opts
+ .db_name()
+ .expect("a database name is required")
+ .is_empty()
+ {
+ panic!("database name is empty");
+ }
+ url
+ } else {
+ "mysql://root:pass@127.0.0.1:3306/mysql".into()
+ }
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+struct Order {
+ order_id: i32,
+ product_id: i32,
+ quantity: i32,
+ amount: f32,
+ shipping: f32,
+ tax: f32,
+ shipping_address: String,
+}
+
+impl Order {
+ fn new(
+ order_id: i32,
+ product_id: i32,
+ quantity: i32,
+ amount: f32,
+ shipping: f32,
+ tax: f32,
+ shipping_address: String,
+ ) -> Self {
+ Self {
+ order_id,
+ product_id,
+ quantity,
+ amount,
+ shipping,
+ tax,
+ shipping_address,
+ }
+ }
+}
+
+async fn handle_request(req: Request, pool: Pool) -> Result, anyhow::Error> {
+ match (req.method(), req.uri().path()) {
+ (&Method::GET, "/") => Ok(Response::new(Body::from(
+ "The valid endpoints are /init /create_order /create_orders /update_order /orders /delete_order",
+ ))),
+
+ // Simply echo the body back to the client.
+ (&Method::POST, "/echo") => Ok(Response::new(req.into_body())),
+
+ // CORS OPTIONS
+ (&Method::OPTIONS, "/init") => Ok(response_build(&String::from(""))),
+ (&Method::OPTIONS, "/create_order") => Ok(response_build(&String::from(""))),
+ (&Method::OPTIONS, "/create_orders") => Ok(response_build(&String::from(""))),
+ (&Method::OPTIONS, "/update_order") => Ok(response_build(&String::from(""))),
+ (&Method::OPTIONS, "/delete_order") => Ok(response_build(&String::from(""))),
+ (&Method::OPTIONS, "/orders") => Ok(response_build(&String::from(""))),
+
+ (&Method::GET, "/init") => {
+ let mut conn = pool.get_conn().await.unwrap();
+ "DROP TABLE IF EXISTS orders;".ignore(&mut conn).await?;
+ "CREATE TABLE orders (order_id INT, product_id INT, quantity INT, amount FLOAT, shipping FLOAT, tax FLOAT, shipping_address VARCHAR(20));".ignore(&mut conn).await?;
+ drop(conn);
+ Ok(response_build("{\"status\":true}"))
+ }
+
+ (&Method::POST, "/create_order") => {
+ let mut conn = pool.get_conn().await.unwrap();
+
+ let byte_stream = hyper::body::to_bytes(req).await?;
+ let order: Order = serde_json::from_slice(&byte_stream).unwrap();
+
+ "INSERT INTO orders (order_id, product_id, quantity, amount, shipping, tax, shipping_address) VALUES (:order_id, :product_id, :quantity, :amount, :shipping, :tax, :shipping_address)"
+ .with(params! {
+ "order_id" => order.order_id,
+ "product_id" => order.product_id,
+ "quantity" => order.quantity,
+ "amount" => order.amount,
+ "shipping" => order.shipping,
+ "tax" => order.tax,
+ "shipping_address" => &order.shipping_address,
+ })
+ .ignore(&mut conn)
+ .await?;
+
+ drop(conn);
+ Ok(response_build("{\"status\":true}"))
+ }
+
+ (&Method::POST, "/create_orders") => {
+ let mut conn = pool.get_conn().await.unwrap();
+
+ let byte_stream = hyper::body::to_bytes(req).await?;
+ let orders: Vec = serde_json::from_slice(&byte_stream).unwrap();
+
+ "INSERT INTO orders (order_id, product_id, quantity, amount, shipping, tax, shipping_address) VALUES (:order_id, :product_id, :quantity, :amount, :shipping, :tax, :shipping_address)"
+ .with(orders.iter().map(|order| {
+ params! {
+ "order_id" => order.order_id,
+ "product_id" => order.product_id,
+ "quantity" => order.quantity,
+ "amount" => order.amount,
+ "shipping" => order.shipping,
+ "tax" => order.tax,
+ "shipping_address" => &order.shipping_address,
+ }
+ }))
+ .batch(&mut conn)
+ .await?;
+
+ drop(conn);
+ Ok(response_build("{\"status\":true}"))
+ }
+
+ (&Method::POST, "/update_order") => {
+ let mut conn = pool.get_conn().await.unwrap();
+
+ let byte_stream = hyper::body::to_bytes(req).await?;
+ let order: Order = serde_json::from_slice(&byte_stream).unwrap();
+
+ "UPDATE orders SET product_id=:product_id, quantity=:quantity, amount=:amount, shipping=:shipping, tax=:tax, shipping_address=:shipping_address WHERE order_id=:order_id"
+ .with(params! {
+ "product_id" => order.product_id,
+ "quantity" => order.quantity,
+ "amount" => order.amount,
+ "shipping" => order.shipping,
+ "tax" => order.tax,
+ "shipping_address" => &order.shipping_address,
+ "order_id" => order.order_id,
+ })
+ .ignore(&mut conn)
+ .await?;
+
+ drop(conn);
+ Ok(response_build("{\"status\":true}"))
+ }
+
+ (&Method::GET, "/orders") => {
+ let mut conn = pool.get_conn().await.unwrap();
+
+ let orders = "SELECT * FROM orders"
+ .with(())
+ .map(&mut conn, |(order_id, product_id, quantity, amount, shipping, tax, shipping_address)| {
+ Order::new(
+ order_id,
+ product_id,
+ quantity,
+ amount,
+ shipping,
+ tax,
+ shipping_address,
+ )},
+ ).await?;
+
+ drop(conn);
+ Ok(response_build(serde_json::to_string(&orders)?.as_str()))
+ }
+
+ (&Method::GET, "/delete_order") => {
+ let mut conn = pool.get_conn().await.unwrap();
+
+ let params: HashMap = req.uri().query().map(|v| {
+ url::form_urlencoded::parse(v.as_bytes()).into_owned().collect()
+ }).unwrap_or_else(HashMap::new);
+ let order_id = params.get("id");
+
+ "DELETE FROM orders WHERE order_id=:order_id"
+ .with(params! { "order_id" => order_id, })
+ .ignore(&mut conn)
+ .await?;
+
+ drop(conn);
+ Ok(response_build("{\"status\":true}"))
+ }
+
+ // Return the 404 Not Found for other routes.
+ _ => {
+ let mut not_found = Response::default();
+ *not_found.status_mut() = StatusCode::NOT_FOUND;
+ Ok(not_found)
+ }
+ }
+}
+
+// CORS headers
+fn response_build(body: &str) -> Response {
+ Response::builder()
+ .header("Access-Control-Allow-Origin", "*")
+ .header("Access-Control-Allow-Methods", "GET, POST, OPTIONS")
+ .header("Access-Control-Allow-Headers", "api,Keep-Alive,User-Agent,Content-Type")
+ .body(Body::from(body.to_owned()))
+ .unwrap()
+}
+
+#[tokio::main(flavor = "current_thread")]
+async fn main() -> Result<(), Box> {
+ let opts = Opts::from_url(&*get_url()).unwrap();
+ let builder = OptsBuilder::from_opts(opts);
+ // The connection pool will have a min of 5 and max of 10 connections.
+ let constraints = PoolConstraints::new(5, 10).unwrap();
+ let pool_opts = PoolOpts::default().with_constraints(constraints);
+ let pool = Pool::new(builder.pool_opts(pool_opts));
+
+ let addr = SocketAddr::from(([0, 0, 0, 0], 8080));
+ let make_svc = make_service_fn(|_| {
+ let pool = pool.clone();
+ async move {
+ Ok::<_, Infallible>(service_fn(move |req| {
+ let pool = pool.clone();
+ handle_request(req, pool)
+ }))
+ }
+ });
+ let server = Server::bind(&addr).serve(make_svc);
+ if let Err(e) = server.await {
+ eprintln!("server error: {}", e);
+ }
+ Ok(())
+}
diff --git a/wasmedge-mysql-nginx/compose.yml b/wasmedge-mysql-nginx/compose.yml
new file mode 100644
index 0000000..86559a8
--- /dev/null
+++ b/wasmedge-mysql-nginx/compose.yml
@@ -0,0 +1,25 @@
+services:
+ frontend:
+ image: nginx:alpine
+ ports:
+ - 8090:80
+ volumes:
+ - ./frontend:/usr/share/nginx/html
+
+ backend:
+ image: demo-microservice
+ platform: wasi/wasm
+ build:
+ context: backend/
+ ports:
+ - 8080:8080
+ environment:
+ DATABASE_URL: mysql://root:whalehello@db:3306/mysql
+ RUST_BACKTRACE: full
+ restart: unless-stopped
+ runtime: io.containerd.wasmedge.v1
+
+ db:
+ image: mariadb:10.9
+ environment:
+ MYSQL_ROOT_PASSWORD: whalehello
diff --git a/wasmedge-mysql-nginx/db/orders.json b/wasmedge-mysql-nginx/db/orders.json
new file mode 100644
index 0000000..9f2d21e
--- /dev/null
+++ b/wasmedge-mysql-nginx/db/orders.json
@@ -0,0 +1,47 @@
+[
+ {
+ "order_id": 1,
+ "product_id": 12,
+ "quantity": 2,
+ "amount": 56.0,
+ "shipping": 15.0,
+ "tax": 2.0,
+ "shipping_address": "Mataderos 2312"
+ },
+ {
+ "order_id": 2,
+ "product_id": 15,
+ "quantity": 3,
+ "amount": 256.0,
+ "shipping": 30.0,
+ "tax": 16.0,
+ "shipping_address": "1234 NW Bobcat"
+ },
+ {
+ "order_id": 3,
+ "product_id": 11,
+ "quantity": 5,
+ "amount": 536.0,
+ "shipping": 50.0,
+ "tax": 24.0,
+ "shipping_address": "20 Havelock"
+ },
+ {
+ "order_id": 4,
+ "product_id": 8,
+ "quantity": 8,
+ "amount": 126.0,
+ "shipping": 20.0,
+ "tax": 12.0,
+ "shipping_address": "224 Pandan Loop"
+ },
+ {
+ "order_id": 5,
+ "product_id": 24,
+ "quantity": 1,
+ "amount": 46.0,
+ "shipping": 10.0,
+ "tax": 2.0,
+ "shipping_address": "No.10 Jalan Besar"
+ }
+]
diff --git a/wasmedge-mysql-nginx/db/update_order.json b/wasmedge-mysql-nginx/db/update_order.json
new file mode 100644
index 0000000..4f39358
--- /dev/null
+++ b/wasmedge-mysql-nginx/db/update_order.json
@@ -0,0 +1,9 @@
+{
+ "order_id": 3,
+ "product_id": 12,
+ "quantity": 2,
+ "amount": 56.0,
+ "shipping": 15.0,
+ "tax": 2.0,
+ "shipping_address": "123 Main Street"
+}
diff --git a/wasmedge-mysql-nginx/frontend/index.html b/wasmedge-mysql-nginx/frontend/index.html
new file mode 100644
index 0000000..d07c384
--- /dev/null
+++ b/wasmedge-mysql-nginx/frontend/index.html
@@ -0,0 +1,102 @@
+
+
+
+ Demo App
+
+
+
+
+
+
+
Loading...
+
+
+
+
Welcome to the Demo!
+
This application is served using nginx for the website, Wasm for the backend, and MariaDB for the database.