docs: replace docker-compose with docker compose (#8195)

This commit is contained in:
crazywoola 2024-09-10 15:02:52 +08:00 committed by GitHub
parent ed37439ef7
commit 5da0182800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,8 +2,8 @@
## Short description ## Short description
Docker-compose certbot configurations with Backward compatibility (without certbot container). docker compose certbot configurations with Backward compatibility (without certbot container).
Use `docker-compose --profile certbot up` to use this features. Use `docker compose --profile certbot up` to use this features.
## The simplest way for launching new servers with SSL certificates ## The simplest way for launching new servers with SSL certificates
@ -18,21 +18,21 @@ Use `docker-compose --profile certbot up` to use this features.
``` ```
execute command: execute command:
```shell ```shell
sudo docker network prune docker network prune
sudo docker-compose --profile certbot up --force-recreate -d docker compose --profile certbot up --force-recreate -d
``` ```
then after the containers launched: then after the containers launched:
```shell ```shell
sudo docker-compose exec -it certbot /bin/sh /update-cert.sh docker compose exec -it certbot /bin/sh /update-cert.sh
``` ```
2. Edit `.env` file and `sudo docker-compose --profile certbot up` again. 2. Edit `.env` file and `docker compose --profile certbot up` again.
set `.env` value additionally set `.env` value additionally
```properties ```properties
NGINX_HTTPS_ENABLED=true NGINX_HTTPS_ENABLED=true
``` ```
execute command: execute command:
```shell ```shell
sudo docker-compose --profile certbot up -d --no-deps --force-recreate nginx docker compose --profile certbot up -d --no-deps --force-recreate nginx
``` ```
Then you can access your serve with HTTPS. Then you can access your serve with HTTPS.
[https://your_domain.com](https://your_domain.com) [https://your_domain.com](https://your_domain.com)
@ -42,8 +42,8 @@ Use `docker-compose --profile certbot up` to use this features.
For SSL certificates renewal, execute commands below: For SSL certificates renewal, execute commands below:
```shell ```shell
sudo docker-compose exec -it certbot /bin/sh /update-cert.sh docker compose exec -it certbot /bin/sh /update-cert.sh
sudo docker-compose exec nginx nginx -s reload docker compose exec nginx nginx -s reload
``` ```
## Options for certbot ## Options for certbot
@ -57,14 +57,14 @@ CERTBOT_OPTIONS=--dry-run
To apply changes to `CERTBOT_OPTIONS`, regenerate the certbot container before updating the certificates. To apply changes to `CERTBOT_OPTIONS`, regenerate the certbot container before updating the certificates.
```shell ```shell
sudo docker-compose --profile certbot up -d --no-deps --force-recreate certbot docker compose --profile certbot up -d --no-deps --force-recreate certbot
sudo docker-compose exec -it certbot /bin/sh /update-cert.sh docker compose exec -it certbot /bin/sh /update-cert.sh
``` ```
Then, reload the nginx container if necessary. Then, reload the nginx container if necessary.
```shell ```shell
sudo docker-compose exec nginx nginx -s reload docker compose exec nginx nginx -s reload
``` ```
## For legacy servers ## For legacy servers
@ -72,5 +72,5 @@ sudo docker-compose exec nginx nginx -s reload
To use cert files dir `nginx/ssl` as before, simply launch containers WITHOUT `--profile certbot` option. To use cert files dir `nginx/ssl` as before, simply launch containers WITHOUT `--profile certbot` option.
```shell ```shell
sudo docker-compose up -d docker compose up -d
``` ```