Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
101 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
# mstdn.asterism.xyz | ||
|
||
on docker swarm | ||
on docker and native postgresql/redis. | ||
|
||
## usage | ||
|
||
stack deploy | ||
deploy | ||
|
||
``` | ||
sudo docker stack deploy mastodon -c mastodon/mstdn-asterism-xyz.yml | ||
cd caddy | ||
sudo docker-compose up -d | ||
cd ../mastodon | ||
sudo docker-compose up -d | ||
``` | ||
|
||
update | ||
|
||
``` | ||
sudo docker-compose -f mastodon/mstdn-asterism-xyz.manage.yml run --rm web rails db:migrate | ||
cd mastodon | ||
sudo docker-compose down | ||
sudo docker-compose up -d | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
{ | ||
email admin@asterism.xyz | ||
} | ||
|
||
https://mstdn.asterism.xyz { | ||
@local { | ||
file | ||
} | ||
@local_media { | ||
path_regexp /system/(.*) | ||
} | ||
@streaming { | ||
path /api/v1/streaming/* | ||
} | ||
@cache_control { | ||
path_regexp ^/(emoji|packs|/system/accounts/avatars|/system/media_attachments/files) | ||
} | ||
|
||
root * /home/mastodon/live/public | ||
log { | ||
output file /var/log/caddy/mastodon.log | ||
} | ||
|
||
encode zstd gzip | ||
|
||
handle_errors { | ||
rewrite 500.html | ||
file_server | ||
} | ||
|
||
header { | ||
Strict-Transport-Security "max-age=31536000" | ||
} | ||
header /sw.js Cache-Control "public, max-age=0" | ||
header @cache_control Cache-Control "public, max-age=31536000, immutable" | ||
|
||
handle @local { | ||
file_server | ||
} | ||
|
||
reverse_proxy @streaming { | ||
to http://streaming:4000 | ||
|
||
transport http { | ||
keepalive 5s | ||
keepalive_idle_conns 10 | ||
} | ||
} | ||
|
||
reverse_proxy { | ||
to http://web:3000 | ||
|
||
header_up X-Forwarded-Port 443 | ||
header_up X-Forwarded-Proto https | ||
|
||
transport http { | ||
keepalive 5s | ||
keepalive_idle_conns 10 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3" | ||
services: | ||
caddy: | ||
image: caddy:2-alpine | ||
environment: | ||
- ACME_AGREE=true | ||
ports: | ||
- 443:443 | ||
- 80:80 | ||
networks: | ||
- private | ||
- public | ||
volumes: | ||
- /caddy_data:/data | ||
- ./Caddyfile:/etc/caddy/Caddyfile | ||
- /var/log/caddy:/var/log/caddy | ||
|
||
networks: | ||
private: | ||
public: | ||
external: true |
File renamed without changes.
File renamed without changes.
File renamed without changes
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.