fix indentation for docker compose code blocks

JesseBot 2023-11-18 18:55:36 +01:00
parent 5431c0f876
commit e6679befc3

@ -25,13 +25,13 @@ RUN mv weed /usr/bin/
```yml ```yml
version: '3.7' version: '3.7'
services: services:
master: master:
build: . build: .
volumes: volumes:
- /data/seaweedfs/master:/data/seaweedfs/master - /data/seaweedfs/master:/data/seaweedfs/master
ports: ports:
- 19333:19333 - 19333:19333
entrypoint: weed master -mdir='/data/seaweedfs/master' -ip=<public ip of server> -volumeSizeLimitMB=100000 -defaultReplication=010 entrypoint: weed master -mdir='/data/seaweedfs/master' -ip=<public ip of server> -volumeSizeLimitMB=100000 -defaultReplication=010
``` ```
3. `docker-compose up` and see if it looks ok 3. `docker-compose up` and see if it looks ok
@ -41,14 +41,14 @@ services:
```yml ```yml
version: '3.7' version: '3.7'
services: services:
volume-sda: volume-sda:
build: . build: .
volumes: volumes:
- /data/seaweedfs/volume:/data/seaweedfs/volume - /data/seaweedfs/volume:/data/seaweedfs/volume
ports: ports:
- 8080:8080 - 8080:8080
- 18080:18080 - 18080:18080
command: weed volume -mserver=<public IP of server 1>:9333 -dir=/data/seaweedfs/volume -ip=<public ip of this server (server2)> command: weed volume -mserver=<public IP of server 1>:9333 -dir=/data/seaweedfs/volume -ip=<public ip of this server (server2)>
``` ```
5. `docker-compose up` on both servers and check that the master sees the volume 5. `docker-compose up` on both servers and check that the master sees the volume
@ -56,15 +56,15 @@ services:
```yml ```yml
version: '3.7' version: '3.7'
services: services:
master: master:
build: . build: .
volumes: volumes:
- /data/seaweedfs/master:/data/seaweedfs/master - /data/seaweedfs/master:/data/seaweedfs/master
- ./security.toml:/etc/seaweedfs/security.toml - ./security.toml:/etc/seaweedfs/security.toml
- ./certs:/etc/seaweedfs/certs - ./certs:/etc/seaweedfs/certs
ports: ports:
- 19333:19333 - 19333:19333
entrypoint: weed master -mdir='/data/seaweedfs/master' -ip=<public ip of server> -volumeSizeLimitMB=100000 -defaultReplication=010 entrypoint: weed master -mdir='/data/seaweedfs/master' -ip=<public ip of server> -volumeSizeLimitMB=100000 -defaultReplication=010
``` ```
7. `docker-compose up` the master and volume. Because the volume server doesn't have the security config, the heartbeat should fail. 7. `docker-compose up` the master and volume. Because the volume server doesn't have the security config, the heartbeat should fail.
8. Copy `security.toml` and `certs/` folder to server2 and add mounts in `docker-compose.yml` file of volume server. 8. Copy `security.toml` and `certs/` folder to server2 and add mounts in `docker-compose.yml` file of volume server.
@ -79,13 +79,13 @@ services:
11. Great, JWT auth works as expected. `docker-compose down`, remove port `9333` from master server `docker-compose.yml`, clean data directory `rm -rf /data/seaweedfs/master/*` and `rm -rf /data/seaweedfs/volume/*` 11. Great, JWT auth works as expected. `docker-compose down`, remove port `9333` from master server `docker-compose.yml`, clean data directory `rm -rf /data/seaweedfs/master/*` and `rm -rf /data/seaweedfs/volume/*`
12. Add caddyserver to master server `docker-compose.yml`. Caddy will automatically and without config issue a SSL cert from Lets Encrypt, redirect traffic from HTTP to HTTPS (on HTTP the header value can be sniffed, please remember to use HTTPS), and we will add config to check for `Authorization` header. A domain is needed for SSL. On master servers `docker-compose.yml`, add a new service: 12. Add caddyserver to master server `docker-compose.yml`. Caddy will automatically and without config issue a SSL cert from Lets Encrypt, redirect traffic from HTTP to HTTPS (on HTTP the header value can be sniffed, please remember to use HTTPS), and we will add config to check for `Authorization` header. A domain is needed for SSL. On master servers `docker-compose.yml`, add a new service:
```yml ```yml
caddy: caddy:
image: caddy:2.3.0-alpine image: caddy:2.3.0-alpine
volumes: volumes:
- ./Caddyfile:/etc/caddy/Caddyfile - ./Caddyfile:/etc/caddy/Caddyfile
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
``` ```
Add `Caddyfile` Add `Caddyfile`
@ -114,29 +114,29 @@ respond @notBearertoken 401
```yml ```yml
version: '3.7' version: '3.7'
services: services:
volume-sda: volume-sda:
build: . build: .
volumes: volumes:
# /dev/sda4 mounts to /data # /dev/sda4 mounts to /data
- /data/seaweedfs/volume:/data/seaweedfs/volume - /data/seaweedfs/volume:/data/seaweedfs/volume
- ./security.toml:/etc/seaweedfs/security.toml - ./security.toml:/etc/seaweedfs/security.toml
- ./certs:/etc/seaweedfs/certs - ./certs:/etc/seaweedfs/certs
ports: ports:
- 8080:8080 - 8080:8080
- 18080:18080 - 18080:18080
command: weed volume -mserver=<master server ip>:9333 -dir=/data/seaweedfs/volume -ip=<publicIp> command: weed volume -mserver=<master server ip>:9333 -dir=/data/seaweedfs/volume -ip=<publicIp>
volume-sdb: volume-sdb:
build: . build: .
volumes: volumes:
# /dev/sdb1 mounts to /data2 # /dev/sdb1 mounts to /data2
- /data2/seaweedfs/volume:/data/seaweedfs/volume - /data2/seaweedfs/volume:/data/seaweedfs/volume
- ./security.toml:/etc/seaweedfs/security.toml - ./security.toml:/etc/seaweedfs/security.toml
- ./certs:/etc/seaweedfs/certs - ./certs:/etc/seaweedfs/certs
ports: ports:
- 8081:8081 - 8081:8081
- 18081:18081 - 18081:18081
command: weed volume -mserver=<master server ip>:9333 -dir=/data/seaweedfs/volume -ip=<publicIp> -port=8081 command: weed volume -mserver=<master server ip>:9333 -dir=/data/seaweedfs/volume -ip=<publicIp> -port=8081
``` ```
## High availability ## High availability