From b28ebdcfb023827a43bdbef17c2c1b5fdecd7c13 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Sun, 16 Oct 2022 20:22:01 +0100 Subject: [PATCH] Add caddy docs --- docker-compose.yml | 26 ++++++++-------- docs/docs/installation/docker_en.md | 39 +++++++++++++++++++----- docs/docs/installation/frontends.include | 6 ++++ 3 files changed, 52 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a43f21be4..b8da67a22 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: # You can prefix the left side with an ip. # Webserver (for reverse-proxies outside of docker) - # If you use a dockerized proxy (see README), you can leave this commented + # If you use a dockerized proxy, you can leave this commented # and use a container link instead. "127.0.0.1:4000:4000", ] @@ -46,14 +46,16 @@ services: - .:/opt/akkoma # Uncomment the following if you want to use a reverse proxy - proxy: - image: caddy:2-alpine - restart: unless-stopped - links: - - akkoma - ports: [ - "443:443", - "80:80" - ] - volumes: - - ./docker-resources/Caddyfile:/etc/caddy/Caddyfile \ No newline at end of file + #proxy: + # image: caddy:2-alpine + # restart: unless-stopped + # links: + # - akkoma + # ports: [ + # "443:443", + # "80:80" + # ] + # volumes: + # - ./docker-resources/Caddyfile:/etc/caddy/Caddyfile + # - ./caddy-data:/data + # - ./caddy-config:/config \ No newline at end of file diff --git a/docs/docs/installation/docker_en.md b/docs/docs/installation/docker_en.md index a176787a6..ecb927649 100644 --- a/docs/docs/installation/docker_en.md +++ b/docs/docs/installation/docker_en.md @@ -1,6 +1,4 @@ -# Installing in docker - -{! installation/otp_vs_from_source_source.include !} +# Installing in Docker ## Installation @@ -22,6 +20,7 @@ releases. ```bash cp docker-resources/env.example .env +echo "DOCKER_USER=$(id -u):$(id -g)" >> .env ``` This probably won't need to be changed, it's only there to set basic environment @@ -43,15 +42,17 @@ in our compose environment. ### Generating your instance ```bash +mkdir pgdata +# if you want to use caddy +mkdir caddy-data +mkdir caddy-config ./docker-resources/manage.sh mix deps.get ./docker-resources/manage.sh mix compile ./docker-resources/manage.sh mix pleroma.instance gen ``` This will ask you a few questions - the defaults are fine for most things, -the database hostname is `db`, and you will want to set the ip to `0.0.0.0` -if you want to access the instance from outside the container (i.e you're using -a reverse proxy on the host) +the database hostname is `db`, and you will want to set the ip to `0.0.0.0`. Now we'll want to copy over the config it just created @@ -125,9 +126,33 @@ Then edit the TLD in your caddyfile to the domain you're serving on. Uncomment the `caddy` section in the docker-compose file, then run `docker-compose up -d` again. -```bash +#### Running a reverse proxy on the host + +If you want, you can also run the reverse proxy on the host. This is a bit more complex, but it's also more flexible. + +Follow the guides for source install for your distribution of choice, or adapt +as needed. Your standard setup can be found in the [Debian Guide](../debian_based_en/#nginx) + +### You're done! + +All that's left is to set up your frontends. + +The standard from-source commands will apply to you, just make sure you +prefix them with `./docker-resources/manage.sh`! + {! installation/frontends.include !} +### Updating Docker Installs + +```bash +git pull +./docker-resources/build.sh +./docker-resources/manage.sh mix deps.get +./docker-resources/manage.sh mix compile +./docker-resources/manage.sh mix ecto.migrate +docker-compose restart akkoma +``` + #### Further reading {! installation/further_reading.include !} diff --git a/docs/docs/installation/frontends.include b/docs/docs/installation/frontends.include index 585be71ae..6da4018a9 100644 --- a/docs/docs/installation/frontends.include +++ b/docs/docs/installation/frontends.include @@ -21,5 +21,11 @@ For most installations, the following will suffice: mix pleroma.frontend install admin-fe --ref stable ``` +=== "Docker" + ```sh + ./docker-resources/manage.sh mix pleroma.frontend install pleroma-fe --ref stable + ./docker-resources/manage.sh mix pleroma.frontend install admin-fe --ref stable + ``` + For more customised installations, refer to [Frontend Management](../../configuration/frontend_management)