doc: update deployment instructions in README
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Glenn Y. Rolland 2024-01-23 16:24:44 +01:00
parent ff62a77d3e
commit fa9abfba79

130
README.md
View file

@ -6,6 +6,15 @@
## Installation
### DNS
setup the following DNS records
*.s3.apps.example.com 10800 IN CNAME dokku.host
s3.apps.example.com 10800 IN CNAME dokku.host
*.pages.apps.example.com 10800 IN CNAME dokku.host
pages.apps.example.com 10800 IN CNAME dokku.host
### Main app
Create app
@ -15,25 +24,31 @@ Create app
Setup internal network
dokku network:create objstorage_net
dokku network:set code attach-post-create objstorage_net
dokku network:set objstorage attach-post-create objstorage_net
Setup storage
mkdir -p /var/lib/dokku/data/storage/objstorage/{meta,data}
touch /var/lib/dokku/data/storage/objstorage/garage.toml
dokku storage:mount objstorage /var/lib/dokku/data/storage/objstorage/garage.toml:/etc/garage.toml
dokku storage:mount objstorage /var/lib/dokku/data/storage/objstorage/meta/:/var/lib/garage/meta/
dokku storage:mount objstorage /var/lib/dokku/data/storage/objstorage/data/:/var/lib/garage/data/
Deploy image
dokku git:from-image automation glenux/service-garage:xxxx
dokku git:from-image objstorage glenux/service-garage:xxxx
Setup proxy
dokku proxy:ports-clear objstorage
Setup storage
dokku storage:mount objstorage /var/lib/dokku/data/storage/cloud/apps:/var/www/html/apps
dokku proxy:report objstorage
Restart
dokku ps:restart objstorage
### Web relay
### Web proxy
Create app
@ -45,33 +60,35 @@ Setup internal network
Setup domain
dokku domains:add objstorage-web web.apps.example.com
dokku domains:add objstorage-web *.web.apps.example.com
dokku domains:add objstorage-web pages.apps.example.com
dokku domains:add objstorage-web *.pages.apps.example.com
Configure docker options
dokku config:set objstorage-web SERVICE_HOST=objstorage.web
dokku config:set objstorage-web SERVICE_PORT=3902
# dokku config:set objstorage-web PORT=5000
Deploy image
dokku git:from-image objstorage-web dokku/service-proxy:latest
Setup proxy
dokku proxy:ports-clear objstorage-web
dokku proxy: FIXME: setup proxy ports
dokku proxy:ports-set objstorage-web http:80:5000
dokku proxy:report objstorage-web
Setup TLS
dokku config:set --no-restart objstorage-web DOKKU_LETSENCRYPT_EMAIL=username@example.com
dokku letsencrypt:set objstorage-web email username@example.com
dokku letsencrypt:enable objstorage-web
Configure docker options
dokku config:set objstorage-web DOKKU_DOCKERFILE_START_CMD="tcp-listen:FIXME:port,fork,reuseaddr tcp-connect:objstorage:FIXME:port"
Deploy image
dokku git:from-image objstorage-web alpine/socat:xxxx
Restart
dokku ps:restart objstorage-web
### S3 relay
### S3 proxy
Create app
@ -79,36 +96,67 @@ Create app
Setup internal network
dokku network:set objstorage-web attach-post-create objstorage_net
Deploy image
dokku git:from-image objstorage-s3 alpine/socat:xxxx
dokku network:set objstorage-s3 attach-post-create objstorage_net
Setup domain
dokku domains:add objstorage s3.apps.example.com
dokku domains:add objstorage *.s3.apps.example.com
Setup proxy
dokku proxy:ports-clear objstorage-web
dokku proxy: FIXME: setup proxy ports
Setup TLS
dokku config:set --no-restart objstorage DOKKU_LETSENCRYPT_EMAIL=username@example.com
dokku letsencrypt:enable objstorage-s3
dokku domains:add objstorage-s3 pages.apps.example.com
dokku domains:add objstorage-s3 *.pages.apps.example.com
Configure docker options
dokku config:set objstorage-web DOKKU_DOCKERFILE_START_CMD="tcp-listen:FIXME:port,fork,reuseaddr tcp-connect:objstorage:FIXME:port"
dokku config:set objstorage-s3 SERVICE_HOST=objstorage.web
dokku config:set objstorage-s3 SERVICE_PORT=3902
# dokku config:set objstorage-s3 PORT=5000
Deploy image
dokku git:from-image objstorage-s3 dokku/service-proxy:latest
Setup proxy
dokku proxy:ports-clear objstorage-s3
dokku proxy:ports-set objstorage-s3 http:80:5000
dokku proxy:report objstorage-s3
Setup TLS
dokku letsencrypt:set objstorage-s3 email username@example.com
dokku letsencrypt:enable objstorage-s3
Restart
dokku ps:restart objstorage-s3
## For each new bucket
dokku domains:add objstorage-s3 BUCKETNAME.s3.apps.example.com
dokku letsencrypt:enable objstorage-s3
dokku domains:add objstorage-web BUCKETNAME.pages.apps.example.com
dokku letsencrypt:enable objstorage-web
alias garage="sudo docker exec -it objstorage.web.1 /garage"
garage bucket create BUCKETNAME
garage bucket list
garage bucket info BUCKETNAME
garage key create BUCKETNAME-key
garage key list
garage key info BUCKETNAME-key
garage bucket allow \
--read \
--write \
--owner \
BUCKETNAME \
--key BUCKETNAME-key
## References
* https://garagehq.deuxfleurs.fr/documentation/cookbook/real-world/
* [Garage: Cookbook](https://garagehq.deuxfleurs.fr/documentation/cookbook/real-world/)
* [Dokku: Network Management](https://dokku.com/docs/networking/network/)
* [Dokku: Routing to non-Dokku managed apps](https://dokku.com/blog/2021/dokku-0.25.0/#routing-to-non-dokku-managed-apps)