synth.download/phosphorus/srv/docker/sharkey/compose.yaml

167 lines
No EOL
5.4 KiB
YAML

# since sharkey/misskey lacks documentation, i'll describe how this works here
#
# basically: we're splitting up the different things sharkey does into their own seperate services, which makes things more responsive (although heavier) rather than being one giant service doing everything.
#
# we keep our default.yml config intact then provide extra *.yml configs for each service respectively
# - each process will load the values of default.yml first, then load other configs and override default.yml's values
# - we keep our default.yml to provide character/file size limits, moto of the day, etc. (db/redis/search settings are confined to .env.secrets in our setup but if you don't need/have it you can remove it from here)
# - our config points each service to their own config, we mount default.yml for each service as well which is read first
#
# then caddy (or if you're using this yourself, whatever reverse proxy is preferred) just reverse proxies each endpoint into their respective "service"
services:
# api obviously handles most api endpoints, as well as serving the web frontend
api:
image: registry.activitypub.software/transfem-org/sharkey:latest
restart: always
ports:
- "127.0.0.1:60628:3001"
networks:
- ip6net
- db
- sharkey
env_file:
- .env.secrets # secrets contains our db password and stuff like that
environment:
- MISSKEY_CONFIG_YML=*.yml
- MISSKEY_CONFIG_DIR=/sharkey/.config
- MK_ONLY_SERVER=1
- MK_DISABLE_CLUSTERING=1
volumes:
- ./files:/sharkey/files # unsure which actually needs access to files, so we share with all services just in case
- ./api:/sharkey/.config
- ./default.yml:/sharkey/.config/default.yml:ro # default/generic config
# queue/process handling. basically the actual backend
worker:
image: registry.activitypub.software/transfem-org/sharkey:latest
restart: always
networks:
- db
- sharkey
env_file:
- .env.secrets
environment:
- MISSKEY_CONFIG_YML=*.yml
- MISSKEY_CONFIG_DIR=/sharkey/.config
- MK_ONLY_QUEUE=1
volumes:
- ./files:/sharkey/files
- ./worker:/sharkey/.config
- ./default.yml:/sharkey/.config/default.yml:ro
# handles federation/activitypub requests
activity:
image: registry.activitypub.software/transfem-org/sharkey:latest
restart: always
ports:
- "127.0.0.1:47815:3002"
networks:
- ip6net
- db
- sharkey
env_file:
- .env.secrets
environment:
- MISSKEY_CONFIG_YML=*.yml
- MISSKEY_CONFIG_DIR=/sharkey/.config
- MK_ONLY_SERVER=1
- MK_DISABLE_CLUSTERING=1
- MK_NO_DAEMONS=1
volumes:
- ./files:/sharkey/files
- ./activity:/sharkey/.config
- ./default.yml:/sharkey/.config/default.yml:ro
# handles media/reverse proxy (/files/*)
media:
image: registry.activitypub.software/transfem-org/sharkey:latest
restart: always
ports:
- "127.0.0.1:57378:3003"
networks:
- ip6net
- db
- sharkey
env_file:
- .env.secrets
environment:
- MISSKEY_CONFIG_YML=*.yml
- MISSKEY_CONFIG_DIR=/sharkey/.config
- MK_ONLY_SERVER=1
- MK_DISABLE_CLUSTERING=1
- MK_NO_DAEMONS=1
volumes:
- ./files:/sharkey/files
- ./media:/sharkey/.config
- ./default.yml:/sharkey/.config/default.yml:ro
# "redis is for caching" WRONG!!! it is long term persistent storage in misskey. for some reason. "caching".
# do NOT wipe redis or you lose a bunch of actual data like timelines and notifications.
# also, we use dragonflydb over redis. personal preference, better performance and stability.
# general dfdb
dragonfly:
image: docker.dragonflydb.io/dragonflydb/dragonfly
restart: always
ulimits:
memlock: -1
networks:
- sharkey
environment:
# these envvars are important in order for dragonflydb/misskey to interact with each other properly, and to load and save all data properly
DFLY_snapshot_cron: '* * * * *'
DFLY_version_check: false
DFLY_default_lua_flags: allow-undeclared-keys # without this, dfdb would immediately complain loading data
DFLY_dbfilename: 'dump.rdb' # misskey expects this
DFLY_df_snapshot_format: false # misskey doesn't know how to handle dfdb's format
DFLY_dir: '/data' # directory with the snapshot/data
volumes:
- ./dragonfly/general:/data
# job queue dfdb
dragonfly-queue:
image: docker.dragonflydb.io/dragonflydb/dragonfly
restart: always
ulimits:
memlock: -1
networks:
- sharkey
environment:
DFLY_port: 6380
DFLY_snapshot_cron: '* * * * *'
DFLY_version_check: false
DFLY_default_lua_flags: allow-undeclared-keys
DFLY_dbfilename: 'dump.rdb'
DFLY_df_snapshot_format: false
DFLY_dir: '/data'
volumes:
- ./dragonfly/queue:/data
# timelines dfdb
dragonfly-tl:
image: docker.dragonflydb.io/dragonflydb/dragonfly
restart: always
ulimits:
memlock: -1
networks:
- sharkey
environment:
DFLY_port: 6381
DFLY_snapshot_cron: '* * * * *'
DFLY_version_check: false
DFLY_default_lua_flags: allow-undeclared-keys
DFLY_dbfilename: 'dump.rdb'
DFLY_df_snapshot_format: false
DFLY_dir: '/data'
volumes:
- ./dragonfly/timelines:/data
networks:
db:
name: postgres_db
external: true
ip6net:
name: ip6net
external: true
sharkey: