@@ -18,13 +18,15 @@ Project structure:
1818```
1919services:
2020 backend:
21- build: backend
21+ build:
22+ context: backend
23+ target: builder
2224 ...
2325 db:
2426 # We use a mariadb image which supports both amd64 & arm64 architecture
25- image: mariadb:10.6.4 -focal
27+ image: mariadb:10-focal
2628 # If you really want to use MySQL, uncomment the following line
27- #image: mysql:8.0.27
29+ #image: mysql:8
2830 ...
2931 proxy:
3032 build: proxy
@@ -37,7 +39,7 @@ Make sure port 80 on the host is not already being in use.
3739> ℹ️ ** _ INFO_ **
3840> For compatibility purpose between ` AMD64 ` and ` ARM64 ` architecture, we use a MariaDB as database instead of MySQL.
3941> You still can use the MySQL image by uncommenting the following line in the Compose file
40- > ` #image: mysql:8.0.27 `
42+ > ` #image: mysql:8 `
4143
4244## Deploy with docker compose
4345
@@ -56,15 +58,13 @@ Creating nginx-flask-mysql_proxy_1 ... done
5658
5759## Expected result
5860
59- Listing containers must show three containers running and the port mapping as below:
61+ Listing containers should show three containers running and the port mapping as below:
6062```
61- $ docker ps
62- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
63- c2c703b66b19 nginx-flask-mysql_proxy "nginx -g 'daemon of…" 39 seconds ago Up 38 seconds 0.0.0.0:80->80/tcp nginx-flask-mysql_proxy_1
64- 2b8a21508c3c nginx-flask-mysql_backend "/bin/sh -c 'flask r…" 9 minutes ago Up 38 seconds 0.0.0.0:5000->5000/tcp nginx-flask-mysql_backend_1
65- 0e6a96ea2028 mysql:8.0.19 "docker-entrypoint.s…" 9 minutes ago Up 38 seconds 3306/tcp, 33060/tcp nginx-flask-mysql_db_1
66-
67-
63+ $ docker compose ps
64+ NAME COMMAND SERVICE STATUS PORTS
65+ nginx-flask-mysql-backend-1 "flask run" backend running 0.0.0.0:8000->8000/tcp
66+ nginx-flask-mysql-db-1 "docker-entrypoint.s…" db running (healthy) 3306/tcp, 33060/tcp
67+ nginx-flask-mysql-proxy-1 "nginx -g 'daemon of…" proxy running 0.0.0.0:80->80/tcp
6868```
6969
7070After the application starts, navigate to ` http://localhost:80 ` in your web browser or run:
@@ -77,3 +77,14 @@ Stop and remove the containers
7777```
7878$ docker compose down
7979```
80+
81+ ## Use with Docker Development Environments
82+
83+ You can use this sample with the Dev Environments feature of Docker Desktop.
84+
85+ ![ Screenshot of creating a Dev Environment in Docker Desktop] ( ../dev-envs.png )
86+
87+ To develop directly on the services inside containers, use the HTTPS Git url of the sample:
88+ ```
89+ https://github.com/docker/awesome-compose/tree/master/nginx-flask-mysql
90+ ```
0 commit comments