From 667bd9facba316a64c0697dc55fa097f973c07b0 Mon Sep 17 00:00:00 2001 From: Nicolas De loof Date: Tue, 10 May 2022 11:59:25 +0200 Subject: [PATCH] Adopt Compose v2 (#240) * Adopt Compose v2 Signed-off-by: Nicolas De Loof --- README.md | 6 +++--- angular/README.md | 12 ++++++------ angular/{docker-compose.yaml => compose.yaml} | 0 apache-php/README.md | 10 +++++----- .../{docker-compose.yaml => compose.yaml} | 0 aspnet-mssql/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 django/README.md | 10 +++++----- django/{docker-compose.yml => compose.yaml} | 0 elasticsearch-logstash-kibana/README.md | 10 +++++----- .../{docker-compose.yml => compose.yaml} | 0 fastapi/README.md | 8 ++++---- fastapi/{docker-compose.yml => compose.yaml} | 0 flask-redis/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 flask/README.md | 10 +++++----- flask/{docker-compose.yaml => compose.yaml} | 0 gitea-postgres/README.md | 14 +++++++------- .../{docker-compose.yaml => compose.yaml} | 0 minecraft/README.md | 16 ++++++++-------- minecraft/{docker-compose.yml => compose.yaml} | 0 nextcloud-postgres/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 nextcloud-redis-mariadb/README.md | 14 +++++++------- .../{docker-compose.yaml => compose.yaml} | 0 nginx-aspnet-mysql/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 nginx-flask-mongo/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 nginx-flask-mysql/README.md | 12 ++++++------ nginx-flask-mysql/backend/hello.py | 2 +- .../{docker-compose.yaml => compose.yaml} | 0 nginx-golang-mysql/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 nginx-golang-postgres/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 nginx-golang/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 nginx-nodejs-redis/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 nginx-wsgi-flask/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 pihole-cloudflared-DoH/README.md | 14 +++++++------- .../{docker-compose.yaml => compose.yaml} | 0 plex/README.md | 12 ++++++------ plex/{docker-compose.yaml => compose.yaml} | 0 portainer/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 postgresql-pgadmin/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 prometheus-grafana/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 react-express-mongodb/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 react-express-mysql/README.md | 12 ++++++------ react-express-mysql/backend/README.md | 18 +++++++++--------- react-express-mysql/backend/package.json | 2 +- react-express-mysql/backend/src/config.js | 2 +- .../{docker-compose.yaml => compose.yaml} | 0 react-java-mysql/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 react-nginx/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 .../{docker-compose.yaml => compose.yaml} | 0 react-rust-postgres/readme.md | 12 ++++++------ sparkjava-mysql/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 sparkjava/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 spring-postgres/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 traefik-golang/README.md | 12 ++++++------ .../{docker-compose.yml => compose.yaml} | 0 vuejs/README.md | 12 ++++++------ vuejs/{docker-compose.yaml => compose.yaml} | 0 wireguard/README.md | 12 ++++++------ .../{docker-compose.yaml => compose.yaml} | 0 wordpress-mysql/README.md | 14 +++++++------- .../{docker-compose.yaml => compose.yaml} | 0 79 files changed, 237 insertions(+), 237 deletions(-) rename angular/{docker-compose.yaml => compose.yaml} (100%) rename apache-php/{docker-compose.yaml => compose.yaml} (100%) rename aspnet-mssql/{docker-compose.yaml => compose.yaml} (100%) rename django/{docker-compose.yml => compose.yaml} (100%) rename elasticsearch-logstash-kibana/{docker-compose.yml => compose.yaml} (100%) rename fastapi/{docker-compose.yml => compose.yaml} (100%) rename flask-redis/{docker-compose.yml => compose.yaml} (100%) rename flask/{docker-compose.yaml => compose.yaml} (100%) rename gitea-postgres/{docker-compose.yaml => compose.yaml} (100%) rename minecraft/{docker-compose.yml => compose.yaml} (100%) rename nextcloud-postgres/{docker-compose.yaml => compose.yaml} (100%) rename nextcloud-redis-mariadb/{docker-compose.yaml => compose.yaml} (100%) rename nginx-aspnet-mysql/{docker-compose.yaml => compose.yaml} (100%) rename nginx-flask-mongo/{docker-compose.yaml => compose.yaml} (100%) rename nginx-flask-mysql/{docker-compose.yaml => compose.yaml} (100%) rename nginx-golang-mysql/{docker-compose.yaml => compose.yaml} (100%) rename nginx-golang-postgres/{docker-compose.yaml => compose.yaml} (100%) rename nginx-golang/{docker-compose.yml => compose.yaml} (100%) rename nginx-nodejs-redis/{docker-compose.yml => compose.yaml} (100%) rename nginx-wsgi-flask/{docker-compose.yaml => compose.yaml} (100%) rename pihole-cloudflared-DoH/{docker-compose.yaml => compose.yaml} (100%) rename plex/{docker-compose.yaml => compose.yaml} (100%) rename portainer/{docker-compose.yaml => compose.yaml} (100%) rename postgresql-pgadmin/{docker-compose.yaml => compose.yaml} (100%) rename prometheus-grafana/{docker-compose.yml => compose.yaml} (100%) rename react-express-mongodb/{docker-compose.yml => compose.yaml} (100%) rename react-express-mysql/{docker-compose.yaml => compose.yaml} (100%) rename react-java-mysql/{docker-compose.yaml => compose.yaml} (100%) rename react-nginx/{docker-compose.yml => compose.yaml} (100%) rename react-rust-postgres/{docker-compose.yaml => compose.yaml} (100%) rename sparkjava-mysql/{docker-compose.yaml => compose.yaml} (100%) rename sparkjava/{docker-compose.yaml => compose.yaml} (100%) rename spring-postgres/{docker-compose.yaml => compose.yaml} (100%) rename traefik-golang/{docker-compose.yml => compose.yaml} (100%) rename vuejs/{docker-compose.yaml => compose.yaml} (100%) rename wireguard/{docker-compose.yaml => compose.yaml} (100%) rename wordpress-mysql/{docker-compose.yaml => compose.yaml} (100%) diff --git a/README.md b/README.md index 4627833..0323edd 100644 --- a/README.md +++ b/README.md @@ -84,12 +84,12 @@ deploying samples of containerized applications with Docker Compose. ### Running a sample -The root directory of each sample contains the `docker-compose.yaml` which +The root directory of each sample contains the `compose.yaml` which describes the configuration of service components. All samples can be run in a local environment by going into the root directory of each one and executing: ```console -docker-compose up -d +docker compose up -d ``` Check the `README.md` of each sample to get more details on the structure and @@ -97,7 +97,7 @@ what is the expected output. To stop and remove all containers of the sample application run: ```console -docker-compose down +docker compose down ``` ## Contribute diff --git a/angular/README.md b/angular/README.md index d501419..19fb867 100644 --- a/angular/README.md +++ b/angular/README.md @@ -9,10 +9,10 @@ Project structure: │   ├── ... │   ├── ... │   .... -└── docker-compose.yaml +└── compose.yaml ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -24,14 +24,14 @@ services: ``` The compose file defines an application with one service `angular`. The image for the service is built with the Dockerfile inside the `angular` directory (build parameter). -When deploying the application, docker-compose maps the container port 4200 to the same port on the host as specified in the file. +When deploying the application, docker compose maps the container port 4200 to the same port on the host as specified in the file. Make sure port 4200 is not being used by another container, otherwise the port should be changed. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "angular_default" with the default driver Building angular Step 1/7 : FROM node:10 @@ -63,5 +63,5 @@ After the application starts, navigate to `http://localhost:4200` in your web br Stop and remove the container ``` -$ docker-compose down +$ docker compose down ``` diff --git a/angular/docker-compose.yaml b/angular/compose.yaml similarity index 100% rename from angular/docker-compose.yaml rename to angular/compose.yaml diff --git a/apache-php/README.md b/apache-php/README.md index d030da4..1ef50ad 100644 --- a/apache-php/README.md +++ b/apache-php/README.md @@ -4,14 +4,14 @@ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml ├── app    ├── Dockerfile    └── index.php ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -22,10 +22,10 @@ services: - ./app:/var/www/html/ ``` -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "php-docker_web" with the default driver Building web Step 1/6 : FROM php:7.2-apache @@ -52,5 +52,5 @@ Hello World! Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/apache-php/docker-compose.yaml b/apache-php/compose.yaml similarity index 100% rename from apache-php/docker-compose.yaml rename to apache-php/compose.yaml diff --git a/aspnet-mssql/README.md b/aspnet-mssql/README.md index 6287cd3..59b1a10 100644 --- a/aspnet-mssql/README.md +++ b/aspnet-mssql/README.md @@ -9,10 +9,10 @@ Project structure: | | └── ... │   ├── ... │   └── Dockerfile -└── docker-compose.yaml +└── compose.yaml ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -28,7 +28,7 @@ services: ``` The compose file defines an application with two services `web` and `db`. The image for the web service is built with the Dockerfile inside the `app` directory (build parameter). -When deploying the application, docker-compose maps the container port 80 to port 80 of the host as specified in the file. +When deploying the application, docker compose maps the container port 80 to port 80 of the host as specified in the file. Make sure port 80 on the host is not being used by another container, otherwise the port should be changed. > ℹ️ **_INFO_** @@ -36,10 +36,10 @@ Make sure port 80 on the host is not being used by another container, otherwise > You still can use the MS SQL Server image by uncommenting the following line in the Compose file > `#image: mcr.microsoft.com/mssql/server` -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "aspnet-mssql_default" with the default driver Building web Step 1/13 : FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build @@ -71,5 +71,5 @@ After the application starts, navigate to `http://localhost:80` in your web brow Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/aspnet-mssql/docker-compose.yaml b/aspnet-mssql/compose.yaml similarity index 100% rename from aspnet-mssql/docker-compose.yaml rename to aspnet-mssql/compose.yaml diff --git a/django/README.md b/django/README.md index 81411ae..2a18733 100644 --- a/django/README.md +++ b/django/README.md @@ -4,7 +4,7 @@ Project structure: ``` . -├── docker-compose.yml +├── compose.yaml ├── app    ├── Dockerfile    ├── requirements.txt @@ -12,7 +12,7 @@ Project structure: ``` -[_docker-compose.yml_](docker-compose.yml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -21,10 +21,10 @@ services: - '8000:8000' ``` -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "django_default" with the default driver Building web Step 1/6 : FROM python:3.7-alpine @@ -48,5 +48,5 @@ After the application starts, navigate to `http://localhost:8000` in your web br Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/django/docker-compose.yml b/django/compose.yaml similarity index 100% rename from django/docker-compose.yml rename to django/compose.yaml diff --git a/elasticsearch-logstash-kibana/README.md b/elasticsearch-logstash-kibana/README.md index bad26e8..9527d05 100644 --- a/elasticsearch-logstash-kibana/README.md +++ b/elasticsearch-logstash-kibana/README.md @@ -4,10 +4,10 @@ Project structure: ``` . -└── docker-compose.yml +└── compose.yaml ``` -[_docker-compose.yml_](docker-compose.yml) +[_compose.yaml_](compose.yaml) ``` services: elasticsearch: @@ -21,10 +21,10 @@ services: ... ``` -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "elasticsearch-logstash-kibana_elastic" with driver "bridge" Creating es ... done Creating log ... done @@ -50,7 +50,7 @@ After the application starts, navigate to below links in your web browser: Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` ## Attribution diff --git a/elasticsearch-logstash-kibana/docker-compose.yml b/elasticsearch-logstash-kibana/compose.yaml similarity index 100% rename from elasticsearch-logstash-kibana/docker-compose.yml rename to elasticsearch-logstash-kibana/compose.yaml diff --git a/fastapi/README.md b/fastapi/README.md index 2dd0ff8..27f5957 100644 --- a/fastapi/README.md +++ b/fastapi/README.md @@ -3,7 +3,7 @@ Project structure: ``` -├── docker-compose.yaml +├── compose.yaml ├── Dockerfile ├── requirements.txt ├── app @@ -12,7 +12,7 @@ Project structure: ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: api: @@ -26,7 +26,7 @@ services: ``` -## Deploy with docker-compose +## Deploy with docker compose ```shell docker-compose up -d --build @@ -49,7 +49,7 @@ After the application starts, navigate to `http://localhost:8000` in your web br Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/fastapi/docker-compose.yml b/fastapi/compose.yaml similarity index 100% rename from fastapi/docker-compose.yml rename to fastapi/compose.yaml diff --git a/flask-redis/README.md b/flask-redis/README.md index dc2fdd7..e494f03 100644 --- a/flask-redis/README.md +++ b/flask-redis/README.md @@ -9,11 +9,11 @@ Project structure: ├── Dockerfile ├── README.md ├── app.py -├── docker-compose.yml +├── compose.yaml └── requirements.txt ``` -[_docker-compose.yml_](docker-compose.yml) +[_compose.yaml_](compose.yaml) ``` services: @@ -31,10 +31,10 @@ services: - redis ``` -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d [+] Running 24/24 ⠿ redis Pulled ... @@ -52,7 +52,7 @@ $ docker-compose up -d Listing containers must show one container running and the port mapping as below: ``` -$ docker-compose ps +$ docker compose ps NAME COMMAND SERVICE STATUS PORTS flask-redis-redis-1 "redis-server --load…" redis running 0.0.0.0:6379->6379/tcp flask-redis-web-1 "/bin/sh -c 'python …" web running 0.0.0.0:5000->5000/tcp @@ -78,5 +78,5 @@ OK Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/flask-redis/docker-compose.yml b/flask-redis/compose.yaml similarity index 100% rename from flask-redis/docker-compose.yml rename to flask-redis/compose.yaml diff --git a/flask/README.md b/flask/README.md index b45b948..d97eb65 100644 --- a/flask/README.md +++ b/flask/README.md @@ -4,7 +4,7 @@ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml ├── app    ├── Dockerfile    ├── requirements.txt @@ -12,7 +12,7 @@ Project structure: ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -21,10 +21,10 @@ services: - '5000:5000' ``` -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "flask_default" with the default driver Building web Step 1/6 : FROM python:3.7-alpine @@ -52,5 +52,5 @@ Hello World! Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/flask/docker-compose.yaml b/flask/compose.yaml similarity index 100% rename from flask/docker-compose.yaml rename to flask/compose.yaml diff --git a/gitea-postgres/README.md b/gitea-postgres/README.md index 02a8089..7fba2b7 100644 --- a/gitea-postgres/README.md +++ b/gitea-postgres/README.md @@ -5,11 +5,11 @@ This example defines one of the base setups for Gitea. More details on how to cu Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: gitea: @@ -23,13 +23,13 @@ services: ... ``` -When deploying this setup, docker-compose maps the gitea container port 3000 to +When deploying this setup, docker compose maps the gitea container port 3000 to the same port of the host as specified in the compose file. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker$ compose up -d +$ docker compose up -d Creating network "gitea-postgres_default" with the default driver Creating gitea-postgres_db_1 ... done Creating gitea-postgres_gitea_1 ... done @@ -58,10 +58,10 @@ Gitea service. Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` To remove all Gitea data, delete the named volumes by passing the `-v` parameter: ``` -$ docker-compose down -v +$ docker compose down -v ``` diff --git a/gitea-postgres/docker-compose.yaml b/gitea-postgres/compose.yaml similarity index 100% rename from gitea-postgres/docker-compose.yaml rename to gitea-postgres/compose.yaml diff --git a/minecraft/README.md b/minecraft/README.md index 8bb44c4..07c8dfd 100644 --- a/minecraft/README.md +++ b/minecraft/README.md @@ -4,11 +4,11 @@ This example defines a basic setup for a Minecraft server. More details on the M Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: minecraft: @@ -20,15 +20,15 @@ services: - "~/minecraft_data:/data" ``` -When deploying this setup, docker-compose maps the Minecraft server port 25565 to +When deploying this setup, docker compose maps the Minecraft server port 25565 to the same port of the host as specified in the compose file. The Minecraft client application can connect to this port directly. This example maps the Minecraft data folder holding all game storage to ~/minecraft_data on the host. -## Deploy with docker-compose +## Deploy with docker compose ``` $ mkdir -p ~/minecraft_data -$ docker-compose up -d +$ docker compose up -d WARNING: Some services (minecraft) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm. Creating network "minecraft_default" with the default driver Creating minecraft_minecraft_1 ... done @@ -49,7 +49,7 @@ CONTAINER ID IMAGE COMMAND CREATED After running `docker-compose up`, the minecraft server takes a bit of time to initialize Minecraft world. You can follow the progress: ``` -$ docker-compose logs +$ docker compose logs ... minecraft_1 | [15:06:39] [Worker-Main-6/INFO]: Preparing spawn area: 94% minecraft_1 | [15:06:39] [Worker-Main-7/INFO]: Preparing spawn area: 94% @@ -72,11 +72,11 @@ Once it is initialized, run your Minecraft application, hit "Play", then "Multip Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` To delete all data, remove all named volumes by passing the -v arguments: ``` -$ docker-compose down -v +$ docker compose down -v ``` \ No newline at end of file diff --git a/minecraft/docker-compose.yml b/minecraft/compose.yaml similarity index 100% rename from minecraft/docker-compose.yml rename to minecraft/compose.yaml diff --git a/nextcloud-postgres/README.md b/nextcloud-postgres/README.md index cc3fa53..b0be42a 100644 --- a/nextcloud-postgres/README.md +++ b/nextcloud-postgres/README.md @@ -7,11 +7,11 @@ further customize the installation and the compose file can be found on the Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: nc: @@ -24,13 +24,13 @@ services: ... ``` -When deploying this setup, docker-compose maps the nextcloud container port 80 to +When deploying this setup, docker compose maps the nextcloud container port 80 to port 80 of the host as specified in the compose file. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker$ compose up -d +$ docker compose up -d Creating network "nextcloud-postgres_default" with the default driver Creating volume "nextcloud-postgres_nc_data" with default driver Pulling nc (nextcloud:apache)... @@ -60,5 +60,5 @@ Nextcloud service. Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nextcloud-postgres/docker-compose.yaml b/nextcloud-postgres/compose.yaml similarity index 100% rename from nextcloud-postgres/docker-compose.yaml rename to nextcloud-postgres/compose.yaml diff --git a/nextcloud-redis-mariadb/README.md b/nextcloud-redis-mariadb/README.md index 5eb893e..8f4b133 100644 --- a/nextcloud-redis-mariadb/README.md +++ b/nextcloud-redis-mariadb/README.md @@ -7,11 +7,11 @@ further customize the installation and the compose file can be found on the Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: nc: @@ -29,13 +29,13 @@ services: ... ``` -When deploying this setup, docker-compose maps the nextcloud container port 80 to +When deploying this setup, docker compose maps the nextcloud container port 80 to port 80 of the host as specified in the compose file. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker$ compose up -d +$ docker compose up -d Creating network "nextcloud-redis-mariadb_redisnet" with the default driver Creating network "nextcloud-redis-mariadb_dbnet" with the default driver Creating volume "nextcloud-redis-mariadb_nc_data" with default driver @@ -68,10 +68,10 @@ Nextcloud service. Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` To delete all data, remove all named volumes by passing the `-v` arguments: ``` -$ docker-compose down -v +$ docker compose down -v ``` diff --git a/nextcloud-redis-mariadb/docker-compose.yaml b/nextcloud-redis-mariadb/compose.yaml similarity index 100% rename from nextcloud-redis-mariadb/docker-compose.yaml rename to nextcloud-redis-mariadb/compose.yaml diff --git a/nginx-aspnet-mysql/README.md b/nginx-aspnet-mysql/README.md index 4dc4d1f..94ce5dd 100644 --- a/nginx-aspnet-mysql/README.md +++ b/nginx-aspnet-mysql/README.md @@ -10,14 +10,14 @@ Project structure: │   └── Program.cs ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml ├── proxy │   ├── conf │   └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -36,7 +36,7 @@ services: ... ``` The compose file defines an application with three services `proxy`, `backend` and `db`. -When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. Make sure port 80 on the host is not already being in use. > ℹ️ **_INFO_** @@ -44,10 +44,10 @@ Make sure port 80 on the host is not already being in use. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d ``` ## Expected result @@ -72,5 +72,5 @@ $ curl localhost:80 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-aspnet-mysql/docker-compose.yaml b/nginx-aspnet-mysql/compose.yaml similarity index 100% rename from nginx-aspnet-mysql/docker-compose.yaml rename to nginx-aspnet-mysql/compose.yaml diff --git a/nginx-flask-mongo/README.md b/nginx-flask-mongo/README.md index 3003832..17e925f 100644 --- a/nginx-flask-mongo/README.md +++ b/nginx-flask-mongo/README.md @@ -4,7 +4,7 @@ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml ├── flask │   ├── Dockerfile │   ├── requirements.txt @@ -14,7 +14,7 @@ Project structure: ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -28,13 +28,13 @@ services: image: mongo ``` The compose file defines an application with three services `web`, `backend` and `db`. -When deploying the application, docker-compose maps port 80 of the web service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the web service container to port 80 of the host as specified in the file. Make sure port 80 on the host is not being used by another container, otherwise the port should be changed. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "nginx-flask-mongo_default" with the default driver Pulling mongo (mongo:)... latest: Pulling from library/mongo @@ -67,5 +67,5 @@ Hello from the MongoDB client! Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-flask-mongo/docker-compose.yaml b/nginx-flask-mongo/compose.yaml similarity index 100% rename from nginx-flask-mongo/docker-compose.yaml rename to nginx-flask-mongo/compose.yaml diff --git a/nginx-flask-mysql/README.md b/nginx-flask-mysql/README.md index 7ee03fd..ba2cdd3 100644 --- a/nginx-flask-mysql/README.md +++ b/nginx-flask-mysql/README.md @@ -4,7 +4,7 @@ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml ├── flask │   ├── Dockerfile │   ├── requirements.txt @@ -14,7 +14,7 @@ Project structure: ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -31,7 +31,7 @@ services: ... ``` The compose file defines an application with three services `proxy`, `backend` and `db`. -When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. Make sure port 80 on the host is not already being in use. > ℹ️ **_INFO_** @@ -39,10 +39,10 @@ Make sure port 80 on the host is not already being in use. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "nginx-flask-mysql_default" with the default driver Pulling db (mysql:8.0.19)... 5.7: Pulling from library/mysql @@ -75,5 +75,5 @@ $ curl localhost:80 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-flask-mysql/backend/hello.py b/nginx-flask-mysql/backend/hello.py index 40c3626..5ffb2b1 100755 --- a/nginx-flask-mysql/backend/hello.py +++ b/nginx-flask-mysql/backend/hello.py @@ -9,7 +9,7 @@ class DBManager: self.connection = mysql.connector.connect( user=user, password=pf.read(), - host=host, # name of the mysql service as set in the docker-compose file + host=host, # name of the mysql service as set in the docker compose file database=database, auth_plugin='mysql_native_password' ) diff --git a/nginx-flask-mysql/docker-compose.yaml b/nginx-flask-mysql/compose.yaml similarity index 100% rename from nginx-flask-mysql/docker-compose.yaml rename to nginx-flask-mysql/compose.yaml diff --git a/nginx-golang-mysql/README.md b/nginx-golang-mysql/README.md index 605c2cc..7155be6 100644 --- a/nginx-golang-mysql/README.md +++ b/nginx-golang-mysql/README.md @@ -10,14 +10,14 @@ Project structure: │   └── main.go ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml ├── proxy │   ├── conf │   └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -36,7 +36,7 @@ services: ... ``` The compose file defines an application with three services `proxy`, `backend` and `db`. -When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. Make sure port 80 on the host is not already being in use. > ℹ️ **_INFO_** @@ -44,10 +44,10 @@ Make sure port 80 on the host is not already being in use. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "nginx-golang-mysql_default" with the default driver Building backend Step 1/8 : FROM golang:1.13-alpine AS build @@ -83,5 +83,5 @@ $ curl localhost:80 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-golang-mysql/docker-compose.yaml b/nginx-golang-mysql/compose.yaml similarity index 100% rename from nginx-golang-mysql/docker-compose.yaml rename to nginx-golang-mysql/compose.yaml diff --git a/nginx-golang-postgres/README.md b/nginx-golang-postgres/README.md index 889cd66..4630c76 100644 --- a/nginx-golang-postgres/README.md +++ b/nginx-golang-postgres/README.md @@ -10,14 +10,14 @@ Project structure: │   └── main.go ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml ├── proxy │   ├── conf │   └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -33,13 +33,13 @@ services: ... ``` The compose file defines an application with three services `proxy`, `backend` and `db`. -When deploying the application, docker-compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the proxy service container to port 80 of the host as specified in the file. Make sure port 80 on the host is not already being in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "nginx-golang-postgres_default" with the default driver Pulling db (postgres:)... latest: Pulling from library/postgres @@ -71,5 +71,5 @@ $ curl localhost:80 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-golang-postgres/docker-compose.yaml b/nginx-golang-postgres/compose.yaml similarity index 100% rename from nginx-golang-postgres/docker-compose.yaml rename to nginx-golang-postgres/compose.yaml diff --git a/nginx-golang/README.md b/nginx-golang/README.md index 543a05f..943fa62 100644 --- a/nginx-golang/README.md +++ b/nginx-golang/README.md @@ -7,14 +7,14 @@ Project structure: ├── backend │   ├── Dockerfile │   └── main.go -├── docker-compose.yml +├── compose.yaml ├── frontend │   ├── Dockerfile │   └── nginx.conf └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: frontend: @@ -27,13 +27,13 @@ services: build: backend ``` The compose file defines an application with two services `frontend` and `backend`. -When deploying the application, docker-compose maps port 80 of the frontend service container to the same port of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the frontend service container to the same port of the host as specified in the file. Make sure port 80 on the host is not already in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "nginx-golang_default" with the default driver Building backend Step 1/7 : FROM golang:1.13 AS build @@ -75,5 +75,5 @@ Hello from Docker! Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-golang/docker-compose.yml b/nginx-golang/compose.yaml similarity index 100% rename from nginx-golang/docker-compose.yml rename to nginx-golang/compose.yaml diff --git a/nginx-nodejs-redis/README.md b/nginx-nodejs-redis/README.md index c2e5886..41a0d2a 100644 --- a/nginx-nodejs-redis/README.md +++ b/nginx-nodejs-redis/README.md @@ -6,7 +6,7 @@ Project structure: ``` . ├── README.md -├── docker-compose.yml +├── compose.yaml ├── nginx │   ├── Dockerfile │   └── nginx.conf @@ -19,7 +19,7 @@ Project structure: ``` -[_docker-compose.yml_](docker-compose.yml) +[_compose.yaml_](compose.yaml) ``` redis: image: 'redislabs/redismod' @@ -46,16 +46,16 @@ redis: - web2 ``` The compose file defines an application with four services `redis`, `nginx`, `web1` and `web2`. -When deploying the application, docker-compose maps port 80 of the nginx service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the nginx service container to port 80 of the host as specified in the file. > ℹ️ **_INFO_** > Redis runs on port 6379 by default. Make sure port 6379 on the host is not being used by another container, otherwise the port should be changed. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d [+] Running 24/24 ⠿ redis Pulled ... ⠿ 565225d89260 Pull complete @@ -103,6 +103,6 @@ web2: Total number of visits is: 3 ## Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/nginx-nodejs-redis/docker-compose.yml b/nginx-nodejs-redis/compose.yaml similarity index 100% rename from nginx-nodejs-redis/docker-compose.yml rename to nginx-nodejs-redis/compose.yaml diff --git a/nginx-wsgi-flask/README.md b/nginx-wsgi-flask/README.md index b468128..96dc33d 100644 --- a/nginx-wsgi-flask/README.md +++ b/nginx-wsgi-flask/README.md @@ -6,7 +6,7 @@ Project structure: ```text . -├── docker-compose.yaml +├── compose.yaml ├── flask │   ├── app.py │   ├── Dockerfile @@ -19,7 +19,7 @@ Project structure:    └── start.sh ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ```yml services: @@ -33,14 +33,14 @@ services: ``` The compose file defines an application with two services `nginx-proxy` and `flask-app`. -When deploying the application, docker-compose maps port 80 of the web service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the web service container to port 80 of the host as specified in the file. Make sure port 80 on the host is not being used by another container, otherwise the port should be changed. -## Deploy with docker-compose +## Deploy with docker compose ```bash -$ docker-compose up -d +$ docker compose up -d Creating network "nginx-wsgi-flask_default" with the default driver Building flask-app ... @@ -71,7 +71,7 @@ Hello World! Stop and remove the containers ```bash -$ docker-compose down +$ docker compose down Stopping nginx-wsgi-flask_nginx-proxy_1 ... done Stopping nginx-wsgi-flask_flask-app_1 ... done Removing nginx-wsgi-flask_nginx-proxy_1 ... done diff --git a/nginx-wsgi-flask/docker-compose.yaml b/nginx-wsgi-flask/compose.yaml similarity index 100% rename from nginx-wsgi-flask/docker-compose.yaml rename to nginx-wsgi-flask/compose.yaml diff --git a/pihole-cloudflared-DoH/README.md b/pihole-cloudflared-DoH/README.md index b555598..2575855 100644 --- a/pihole-cloudflared-DoH/README.md +++ b/pihole-cloudflared-DoH/README.md @@ -7,11 +7,11 @@ Project structure: ``` . ├── .env -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` yaml services: pihole: @@ -46,18 +46,18 @@ Before deploying this setup, you need to configure the following values in the [ If you would like to disable conditional forwarding, delete the environment variables starting with "CONDITIONAL_FORWARDING" ### Container DNS (optional, default: disabled) -In the docker-compose file, dns is added as a comment. To enable dns remove '#' in front of the following lines: +In the docker compose file, dns is added as a comment. To enable dns remove '#' in front of the following lines: ``` yaml dns: - 127.0.0.1 # "Sets your container's resolve settings to localhost so it can resolve DHCP hostnames [...]" - github.com/pi-hole/docker-pi-hole - 1.1.1.1 # Backup server ``` -## Deploy with docker-compose +## Deploy with docker compose When deploying this setup, the admin web interface will be available on port 8080 (e.g. http://localhost:8080/admin). ``` shell -$ docker-compose up -d +$ docker compose up -d Starting cloudflared ... done Starting pihole ... done ``` @@ -78,9 +78,9 @@ Navigate to `http://localhost:8080` in your web browser to access the installed Stop the containers with ``` shell -$ docker-compose down +$ docker compose down # To delete all data run: -$ docker-compose down -v +$ docker compose down -v ``` ## Troubleshooting diff --git a/pihole-cloudflared-DoH/docker-compose.yaml b/pihole-cloudflared-DoH/compose.yaml similarity index 100% rename from pihole-cloudflared-DoH/docker-compose.yaml rename to pihole-cloudflared-DoH/compose.yaml diff --git a/plex/README.md b/plex/README.md index 78988c9..9685267 100644 --- a/plex/README.md +++ b/plex/README.md @@ -8,11 +8,11 @@ Project structure: ``` . ├── .env -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` yaml services: plex: @@ -28,11 +28,11 @@ Before deploying this setup, you need to configure the following values in the [ ### Hardware Acceleration Check out the description for Hardware Acceleration support in the [documentation](https://github.com/linuxserver/docker-plex). -## Deploy with docker-compose +## Deploy with docker compose When deploying this setup, the web interface will be available on port 32400 (e.g. http://localhost:32400/web). ``` shell -$ docker-compose up -d +$ docker compose up -d Starting plex ... done ``` @@ -51,7 +51,7 @@ Navigate to `http://localhost:32400/web` in your web browser to access the plex Stop the containers with ``` shell -$ docker-compose down +$ docker compose down # To delete all data run: -$ docker-compose down -v +$ docker compose down -v ``` diff --git a/plex/docker-compose.yaml b/plex/compose.yaml similarity index 100% rename from plex/docker-compose.yaml rename to plex/compose.yaml diff --git a/portainer/README.md b/portainer/README.md index 6c2e948..f5c4344 100644 --- a/portainer/README.md +++ b/portainer/README.md @@ -10,22 +10,22 @@ You can try out the public demo instance first: http://demo.portainer.io/ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` yaml services: portainer: image: portainer/portainer-ce:alpine ``` -## Deploy with docker-compose +## Deploy with docker compose When deploying this setup, the web interface will be available on port 9000 (e.g. http://localhost:9000). ``` shell -$ docker-compose up -d +$ docker compose up -d Starting portainer ... done ``` @@ -45,9 +45,9 @@ Navigate to `http://localhost:9000` in your web browser to access the portainer Stop the containers with ``` shell -$ docker-compose down +$ docker compose down # To delete all data run: -$ docker-compose down -v +$ docker compose down -v ``` ## Troubleshooting diff --git a/portainer/docker-compose.yaml b/portainer/compose.yaml similarity index 100% rename from portainer/docker-compose.yaml rename to portainer/compose.yaml diff --git a/postgresql-pgadmin/README.md b/postgresql-pgadmin/README.md index 6a5379a..2b9a857 100644 --- a/postgresql-pgadmin/README.md +++ b/postgresql-pgadmin/README.md @@ -6,11 +6,11 @@ Project structure: ``` . ├── .env -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` yaml services: postgres: @@ -30,11 +30,11 @@ Before deploying this setup, you need to configure the following values in the [ - PGADMIN_MAIL - PGADMIN_PW -## Deploy with docker-compose +## Deploy with docker compose When deploying this setup, the pgAdmin web interface will be available at port 5050 (e.g. http://localhost:5050). ``` shell -$ docker-compose up +$ docker compose up Starting postgres ... done Starting pgadmin ... done ``` @@ -62,7 +62,7 @@ d3cde3b455ee dpage/pgadmin4:latest "/entrypoint.sh" 9 minute Stop the containers with ``` shell -$ docker-compose down +$ docker compose down # To delete all data run: -$ docker-compose down -v +$ docker compose down -v ``` diff --git a/postgresql-pgadmin/docker-compose.yaml b/postgresql-pgadmin/compose.yaml similarity index 100% rename from postgresql-pgadmin/docker-compose.yaml rename to postgresql-pgadmin/compose.yaml diff --git a/prometheus-grafana/README.md b/prometheus-grafana/README.md index 7e1e11f..ae62ba9 100644 --- a/prometheus-grafana/README.md +++ b/prometheus-grafana/README.md @@ -4,7 +4,7 @@ Project structure: ``` . -├── docker-compose.yml +├── compose.yaml ├── grafana │   └── datasource.yml ├── prometheus @@ -12,7 +12,7 @@ Project structure: └── README.md ``` -[_docker-compose.yml_](docker-compose.yml) +[_compose.yaml_](compose.yaml) ``` services: prometheus: @@ -27,13 +27,13 @@ services: - 3000:3000 ``` The compose file defines a stack with two services `prometheus` and `grafana`. -When deploying the stack, docker-compose maps port the default ports for each service to the equivalent ports on the host in order to inspect easier the web interface of each service. +When deploying the stack, docker compose maps port the default ports for each service to the equivalent ports on the host in order to inspect easier the web interface of each service. Make sure the ports 9090 and 3000 on the host are not already in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "prometheus-grafana_default" with the default driver Creating volume "prometheus-grafana_prom_data" with default driver ... @@ -61,5 +61,5 @@ Navigate to `http://localhost:9090` in your web browser to access directly the w Stop and remove the containers. Use `-v` to remove the volumes if looking to erase all data. ``` -$ docker-compose down -v +$ docker compose down -v ``` diff --git a/prometheus-grafana/docker-compose.yml b/prometheus-grafana/compose.yaml similarity index 100% rename from prometheus-grafana/docker-compose.yml rename to prometheus-grafana/compose.yaml diff --git a/react-express-mongodb/README.md b/react-express-mongodb/README.md index 46c7668..7a30be9 100644 --- a/react-express-mongodb/README.md +++ b/react-express-mongodb/README.md @@ -7,14 +7,14 @@ Project structure: ├── backend │ ├── Dockerfile │ ... -├── docker-compose.yaml +├── compose.yaml ├── frontend │ ├── ... │ └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: frontend: @@ -42,13 +42,13 @@ 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. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "react-express-mongodb_default" with the default driver Building frontend Step 1/9 : FROM node:13.13.0-stretch-slim @@ -78,7 +78,7 @@ After the application starts, navigate to `http://localhost:3000` in your web br Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping server ... done Stopping frontend ... done Stopping mongo ... done diff --git a/react-express-mongodb/docker-compose.yml b/react-express-mongodb/compose.yaml similarity index 100% rename from react-express-mongodb/docker-compose.yml rename to react-express-mongodb/compose.yaml diff --git a/react-express-mysql/README.md b/react-express-mysql/README.md index 4e136b6..66fad57 100644 --- a/react-express-mysql/README.md +++ b/react-express-mysql/README.md @@ -9,14 +9,14 @@ Project structure: │   ... ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml ├── frontend │   ├── ... │   └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -39,7 +39,7 @@ 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_** @@ -47,10 +47,10 @@ Make sure port 3000 on the host is not already being in use. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "react-express-mysql_default" with the default driver Building backend Step 1/16 : FROM node:10 @@ -87,7 +87,7 @@ $ curl localhost:80 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping react-express-mysql_frontend_1 ... done Stopping react-express-mysql_backend_1 ... done Stopping react-express-mysql_db_1 ... done diff --git a/react-express-mysql/backend/README.md b/react-express-mysql/backend/README.md index ddb57b3..e4429b9 100755 --- a/react-express-mysql/backend/README.md +++ b/react-express-mysql/backend/README.md @@ -4,12 +4,12 @@ ### Local Development Features - - **Dev as close to prod as you can**. docker-compose builds a local development image that is just like production image except for the below dev-only features needed in image. Goal is to have dev env be as close to test and prod as possible while still giving all the nice tools to make you a happy dev. + - **Dev as close to prod as you can**. docker compose builds a local development image that is just like production image except for the below dev-only features needed in image. Goal is to have dev env be as close to test and prod as possible while still giving all the nice tools to make you a happy dev. - **Prevent needing node/npm on host**. Installs `node_modules` outside app root in container so local development won't run into a problem of bind-mounting over it with local source code. This means it will run `npm install` once on container build and you don't need to run npm on host or on each docker run. It will re-run on build if you change `package.json`. - **One line startup**. Uses `docker-compose up` for single-line build and run of local development server. - - **Edit locally while code runs in container**. docker-compose uses proper bind-mounts of host source code into container so you can edit locally while running code in Linux container. - - **Use nodemon in container**. docker-compose uses nodemon for development for auto-restarting node in container when you change files on host. - - **Enable debug from host to container**. opens the inspect port 9229 for using host-based debugging like chrome tools or VS Code. Nodemon enables `--inspect` by default in docker-compose. + - **Edit locally while code runs in container**. docker compose uses proper bind-mounts of host source code into container so you can edit locally while running code in Linux container. + - **Use nodemon in container**. docker compose uses nodemon for development for auto-restarting node in container when you change files on host. + - **Enable debug from host to container**. opens the inspect port 9229 for using host-based debugging like chrome tools or VS Code. Nodemon enables `--inspect` by default in docker compose. - **Provides VSCode debug configs and tasks for tests**. for Visual Studio Code fans, `.vscode` directory has the goods, thanks to @JPLemelin. - **Small image and quick re-builds**. `COPY` in `package.json` and run `npm install` **before** `COPY` in your source code. This saves big on build time and keep container lean. - **Bind-mount package.json**. This allows adding packages in realtime without rebuilding images. e.g. `dce node npm install --save ` @@ -18,19 +18,19 @@ ### Production-minded Features - **Use Docker build-in healthchecks**. uses Dockerfile `HEALTHCHECK` with `/healthz` route to help Docker know if your container is running properly (example always returns 200, but you get the idea). - - **Proper NODE_ENV use**. Defaults to `NODE_ENV=production` in Dockerfile and overrides to `development` in docker-compose for local dev. - - **Don't add dev dependencies into production image**. Proper `NODE_ENV` use means dev dependencies won't be installed in container by default. Using docker-compose will build with them by default. + - **Proper NODE_ENV use**. Defaults to `NODE_ENV=production` in Dockerfile and overrides to `development` in docker compose for local dev. + - **Don't add dev dependencies into production image**. Proper `NODE_ENV` use means dev dependencies won't be installed in container by default. Using docker compose will build with them by default. - **Enables proper SIGTERM/SIGINT for graceful exit**. Defaults to `node index.js` rather then npm for allowing graceful shutdown of node. npm doesn't pass SIGTERM/SIGINT properly (you can't ctrl-c when running `docker run` in foreground). To get `node index.js` to graceful exit, extra signal-catching code is needed. The `Dockerfile` and `index.js` document the options and links to known issues. - **Use docker-stack.yml example for Docker Swarm deployments**. ### Assumptions - - You have Docker and Docker-Compose installed (Docker for Mac, Docker for Windows, get.docker.com and manual Compose installed for Linux). + - You have Docker and docker compose installed (Docker for Mac, Docker for Windows, get.docker.com and manual Compose installed for Linux). - You want to use Docker for local development (i.e. never need to install node/npm on host) and have dev and prod Docker images be as close as possible. - You don't want to loose fidelity in your dev workflow. You want a easy environment setup, using local editors, node debug/inspect, local code repo, while node server runs in a container. - You use `docker-compose` for local development only (docker-compose was never intended to be a production deployment tool anyway). - - The `docker-compose.yml` is not meant for `docker stack deploy` in Docker Swarm, it's meant for happy local development. Use `docker-stack.yml` for Swarm. + - The `compose.yaml` is not meant for `docker stack deploy` in Docker Swarm, it's meant for happy local development. Use `docker-stack.yml` for Swarm. ### Getting Started @@ -46,7 +46,7 @@ If this was your Node.js app, to start local development you would: - Compose should detect if you need to rebuild due to changed package.json or Dockerfile, but `docker-compose build` works for manually building. - Be sure to use `docker-compose down` to cleanup after your done dev'ing. -If you wanted to add a package while docker-compose was running your app: +If you wanted to add a package while docker compose was running your app: - `docker-compose exec node npm install --save ` - This installs it inside the running container. - Nodemon will detect the change and restart. diff --git a/react-express-mysql/backend/package.json b/react-express-mysql/backend/package.json index a906835..7e16cc3 100755 --- a/react-express-mysql/backend/package.json +++ b/react-express-mysql/backend/package.json @@ -2,7 +2,7 @@ "name": "node-docker-good-defaults", "private": true, "version": "2.0.1", - "description": "Node.js Hello world app using docker features for easy docker-compose local dev and solid production defaults", + "description": "Node.js Hello world app using docker features for easy docker compose local dev and solid production defaults", "author": "Bret Fisher ", "main": "src/index.js", "scripts": { diff --git a/react-express-mysql/backend/src/config.js b/react-express-mysql/backend/src/config.js index e86ca33..ada3466 100644 --- a/react-express-mysql/backend/src/config.js +++ b/react-express-mysql/backend/src/config.js @@ -14,7 +14,7 @@ module.exports = { : null }, port: process.env.PORT || 8080 - // if you're not using docker-compose for local development, this will default to 8080 + // if you're not using docker compose for local development, this will default to 8080 // to prevent non-root permission problems with 80. Dockerfile is set to make this 80 // because containers don't have that issue :) }; diff --git a/react-express-mysql/docker-compose.yaml b/react-express-mysql/compose.yaml similarity index 100% rename from react-express-mysql/docker-compose.yaml rename to react-express-mysql/compose.yaml diff --git a/react-java-mysql/README.md b/react-java-mysql/README.md index 25e83da..0a5acb8 100644 --- a/react-java-mysql/README.md +++ b/react-java-mysql/README.md @@ -9,14 +9,14 @@ Project structure: │   ... ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml ├── frontend │   ├── ... │   └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -35,7 +35,7 @@ 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_** @@ -43,10 +43,10 @@ Make sure port 3000 on the host is not already being in use. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "react-java-mysql_default" with the default driver Building backend Step 1/17 : FROM maven:3.6.3-jdk-11 AS builder @@ -74,7 +74,7 @@ After the application starts, navigate to `http://localhost:3000` in your web br Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping react-java-mysql_backend_1 ... done Stopping react-java-mysql_frontend_1 ... done Stopping react-java-mysql_db_1 ... done diff --git a/react-java-mysql/docker-compose.yaml b/react-java-mysql/compose.yaml similarity index 100% rename from react-java-mysql/docker-compose.yaml rename to react-java-mysql/compose.yaml diff --git a/react-nginx/README.md b/react-nginx/README.md index f6b7941..b26b024 100755 --- a/react-nginx/README.md +++ b/react-nginx/README.md @@ -5,7 +5,7 @@ Project structure: ``` -├── docker-compose.yml +├── compose.yaml ├── Dockerfile ├── .dockerignore ├── .nginx @@ -22,7 +22,7 @@ Project structure: ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: @@ -35,12 +35,12 @@ services: ``` The compose file defines an application with an services `frontend`. -When deploying the application, docker-compose maps port 80 of the frontend service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the frontend service container to port 80 of the host as specified in the file. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Building frontend Sending build context to Docker daemon 1.49MB @@ -81,7 +81,7 @@ After the application start, navigate to http://localhost in your browser: Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping frontend ... done Removing frontend ... done Removing network react-nginx_default diff --git a/react-nginx/docker-compose.yml b/react-nginx/compose.yaml similarity index 100% rename from react-nginx/docker-compose.yml rename to react-nginx/compose.yaml diff --git a/react-rust-postgres/docker-compose.yaml b/react-rust-postgres/compose.yaml similarity index 100% rename from react-rust-postgres/docker-compose.yaml rename to react-rust-postgres/compose.yaml diff --git a/react-rust-postgres/readme.md b/react-rust-postgres/readme.md index 4f2690f..b0662aa 100644 --- a/react-rust-postgres/readme.md +++ b/react-rust-postgres/readme.md @@ -8,14 +8,14 @@ Project structure: ├── backend │   ├── Dockerfile │   ... -├── docker-compose.yaml +├── compose.yaml ├── frontend │   ├── ... │   └── Dockerfile └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -31,13 +31,13 @@ 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. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "react-rust-postgres_default" with the default driver Building backend ... @@ -65,7 +65,7 @@ After the application starts, navigate to `http://localhost:3000` in your web br Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping react-rust-postgres_backend_1 ... done Stopping react-rust-postgres_frontend_1 ... done Stopping react-rust-postgres_db_1 ... done diff --git a/sparkjava-mysql/README.md b/sparkjava-mysql/README.md index 945377f..0b09e02 100644 --- a/sparkjava-mysql/README.md +++ b/sparkjava-mysql/README.md @@ -9,12 +9,12 @@ Project structure: │   └── ... ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -29,7 +29,7 @@ services: ... ``` The compose file defines an application with two services `backend` and `db`. -When deploying the application, docker-compose maps port 8080 of the backend service container to port 80 of the host as specified in the file. +When deploying the application, docker compose maps port 8080 of the backend service container to port 80 of the host as specified in the file. Make sure port 8080 on the host is not already being in use. > ℹ️ **_INFO_** @@ -37,10 +37,10 @@ Make sure port 8080 on the host is not already being in use. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "sparkjava-mysql_default" with the default driver Building backend ... @@ -68,7 +68,7 @@ $ curl localhost:8080 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping sparkjava-mysql_backend_1 ... done Stopping sparkjava-mysql_db_1 ... done Removing sparkjava-mysql_backend_1 ... done diff --git a/sparkjava-mysql/docker-compose.yaml b/sparkjava-mysql/compose.yaml similarity index 100% rename from sparkjava-mysql/docker-compose.yaml rename to sparkjava-mysql/compose.yaml diff --git a/sparkjava/README.md b/sparkjava/README.md index 2f2f469..224f72f 100644 --- a/sparkjava/README.md +++ b/sparkjava/README.md @@ -4,14 +4,14 @@ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml ├── README.md └── sparkjava ├── Dockerfile └── ... ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: sparkjava: @@ -20,13 +20,13 @@ services: - 8080:8080 ``` The compose file defines an application with one service `sparkjava`. -When deploying the application, docker-compose maps port 8080 of the sparkjava service container to port 8080 of the host as specified in the file. +When deploying the application, docker compose maps port 8080 of the sparkjava service container to port 8080 of the host as specified in the file. Make sure port 8080 on the host is not already being in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "sparkjava_default" with the default driver Building sparkjava Step 1/11 : FROM maven:3.6.3-jdk-11 AS build @@ -54,7 +54,7 @@ Hello from Docker! Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping sparkjava_sparkjava_1 ... done Removing sparkjava_sparkjava_1 ... done Removing network sparkjava_default diff --git a/sparkjava/docker-compose.yaml b/sparkjava/compose.yaml similarity index 100% rename from sparkjava/docker-compose.yaml rename to sparkjava/compose.yaml diff --git a/spring-postgres/README.md b/spring-postgres/README.md index a59a5fd..da63582 100644 --- a/spring-postgres/README.md +++ b/spring-postgres/README.md @@ -9,12 +9,12 @@ Project structure: │   └── ... ├── db │   └── password.txt -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: backend: @@ -26,13 +26,13 @@ services: ... ``` The compose file defines an application with two services `backend` and `db`. -When deploying the application, docker-compose maps port 8080 of the backend service container to port 8080 of the host as specified in the file. +When deploying the application, docker compose maps port 8080 of the backend service container to port 8080 of the host as specified in the file. Make sure port 8080 on the host is not already being in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "spring-postgres_default" with the default driver Building backend Step 1/11 : FROM maven:3.5-jdk-9 AS build @@ -70,7 +70,7 @@ $ curl localhost:8080 Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping spring-postgres_db_1 ... done Stopping spring-postgres_backend_1 ... done Removing spring-postgres_db_1 ... done diff --git a/spring-postgres/docker-compose.yaml b/spring-postgres/compose.yaml similarity index 100% rename from spring-postgres/docker-compose.yaml rename to spring-postgres/compose.yaml diff --git a/traefik-golang/README.md b/traefik-golang/README.md index f1c287e..af3364c 100644 --- a/traefik-golang/README.md +++ b/traefik-golang/README.md @@ -7,11 +7,11 @@ Project structure: ├── backend │   ├── Dockerfile │   └── main.go -├── docker-compose.yml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: frontend: @@ -34,13 +34,13 @@ services: ``` The compose file defines an application with two services `frontend` and `backend`. -When deploying the application, docker-compose maps port 80 of the frontend service container to the same port of the host as specified in the file. +When deploying the application, docker compose maps port 80 of the frontend service container to the same port of the host as specified in the file. Make sure port 80 on the host is not already being in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "traefik-golang_default" with the default driver Building backend Step 1/7 : FROM golang:1.13 AS build @@ -92,5 +92,5 @@ Hello from Docker! Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` diff --git a/traefik-golang/docker-compose.yml b/traefik-golang/compose.yaml similarity index 100% rename from traefik-golang/docker-compose.yml rename to traefik-golang/compose.yaml diff --git a/vuejs/README.md b/vuejs/README.md index c336103..8ff567f 100644 --- a/vuejs/README.md +++ b/vuejs/README.md @@ -4,14 +4,14 @@ Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml ├── README.md └── vuejs ├── Dockerfile └── ... ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: web: @@ -23,13 +23,13 @@ services: - /project/node_modules ``` The compose file defines an application with one service `vuejs`. -When deploying the application, docker-compose maps port 8080 of the web service container to port 8080 of the host as specified in the file. +When deploying the application, docker compose maps port 8080 of the web service container to port 8080 of the host as specified in the file. Make sure port 8080 on the host is not already being in use. -## Deploy with docker-compose +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "vuejs_default" with the default driver Building web Step 1/8 : FROM node:13.10.1-alpine @@ -54,7 +54,7 @@ After the application starts, navigate to `http://localhost:80` in your web brow Stop and remove the containers ``` -$ docker-compose down +$ docker compose down Stopping vuejs_web_1 ... done Removing vuejs_web_1 ... done Removing network vuejs_default diff --git a/vuejs/docker-compose.yaml b/vuejs/compose.yaml similarity index 100% rename from vuejs/docker-compose.yaml rename to vuejs/compose.yaml diff --git a/wireguard/README.md b/wireguard/README.md index da2070f..e98a527 100644 --- a/wireguard/README.md +++ b/wireguard/README.md @@ -6,11 +6,11 @@ Project structure: ``` . ├── .env -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` yaml services: wireguard: @@ -24,11 +24,11 @@ Before deploying this setup, you need to configure the following values in the [ - TIMEZONE - VPN_SERVER_URL (recommended setting up a server url with e.g. http://www.duckdns.org/ if you don't own a domain) -## Deploy with docker-compose +## Deploy with docker compose When deploying this setup, the log will show relevant information. You need to forward the external port 51820 to access your VPN from outside. ``` shell -$ docker-compose up +$ docker compose up Starting wireguard ... wireguard | **** It seems the wireguard module is already active. Skipping kernel header install and module compilation. **** wireguard | **** Server mode is selected **** @@ -63,9 +63,9 @@ Install your Wireguard client on an Apple device by downloading the wireguard ap Stop the containers with ``` shell -$ docker-compose down +$ docker compose down # To delete all data run: -$ docker-compose down -v +$ docker compose down -v ``` ## Troubleshooting diff --git a/wireguard/docker-compose.yaml b/wireguard/compose.yaml similarity index 100% rename from wireguard/docker-compose.yaml rename to wireguard/compose.yaml diff --git a/wordpress-mysql/README.md b/wordpress-mysql/README.md index e7ea59d..2cc3578 100644 --- a/wordpress-mysql/README.md +++ b/wordpress-mysql/README.md @@ -5,11 +5,11 @@ This example defines one of the basic setups for WordPress. More details on how Project structure: ``` . -├── docker-compose.yaml +├── compose.yaml └── README.md ``` -[_docker-compose.yaml_](docker-compose.yaml) +[_compose.yaml_](compose.yaml) ``` services: db: @@ -26,7 +26,7 @@ services: ... ``` -When deploying this setup, docker-compose maps the WordPress container port 80 to +When deploying this setup, docker compose maps the WordPress container port 80 to port 80 of the host as specified in the compose file. > ℹ️ **_INFO_** @@ -34,10 +34,10 @@ port 80 of the host as specified in the compose file. > 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 +## Deploy with docker compose ``` -$ docker-compose up -d +$ docker compose up -d Creating network "wordpress-mysql_default" with the default driver Creating volume "wordpress-mysql_db_data" with default driver ... @@ -63,10 +63,10 @@ Navigate to `http://localhost:80` in your web browser to access WordPress. Stop and remove the containers ``` -$ docker-compose down +$ docker compose down ``` To remove all WordPress data, delete the named volumes by passing the `-v` parameter: ``` -$ docker-compose down -v +$ docker compose down -v ``` diff --git a/wordpress-mysql/docker-compose.yaml b/wordpress-mysql/compose.yaml similarity index 100% rename from wordpress-mysql/docker-compose.yaml rename to wordpress-mysql/compose.yaml