From 6f1bf4cce6d4a3e6c1a3f4053e24669dde91516c Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 2 Dec 2023 21:10:05 +0100 Subject: [PATCH] add pixelfed.de compose --- pixelfed.de-compose.md | 121 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 pixelfed.de-compose.md diff --git a/pixelfed.de-compose.md b/pixelfed.de-compose.md new file mode 100644 index 0000000..c193c99 --- /dev/null +++ b/pixelfed.de-compose.md @@ -0,0 +1,121 @@ +# compose stack for pixelfed.de + +My current compose file, as the one in my +[blog post about my setup](https://blog.pixelfed.de/2020/05/29/pixelfed-in-docker/) +has aged quite a bit. + +Please keep in mind that I use an external database cluster, and an external load +balancer, so these services are not listed in my compose. + +```yaml +--- +version: '3' + +networks: + back: + +services: + app: + image: "quay.io/zknt/pixelfed:dev" + restart: "unless-stopped" + networks: + back: {} + depends_on: + - redis + env_file: + - ./env + ports: + - "127.0.0.1:8098:80" + volumes: + - "./data/storage:/var/www/storage" + - "./env:/var/www/.env" + - "./robots.txt:/var/www/public/robots.txt:ro" + - "./docker-php-ext-opcache.ini:/usr/local/etc/php/conf.d/opcache.ini:ro" + + websockets: + image: "quay.io/zknt/pixelfed:dev" + restart: "unless-stopped" + depends_on: + - redis + - app + env_file: + - ./env + volumes: + - "./data/storage:/var/www/storage" + - "./env:/var/www/.env" + - "./docker-php-ext-opcache.ini:/usr/local/etc/php/conf.d/opcache.ini:ro" + ports: + - "127.0.0.1:8099:6001" + networks: + back: {} + entrypoint: /websockets-entrypoint.sh + + worker: + image: "quay.io/zknt/pixelfed:dev" + restart: "unless-stopped" + networks: + back: {} + depends_on: + - redis + - app + env_file: + - ./env + volumes: + - "./data/storage:/var/www/storage" + - "./env:/var/www/.env" + entrypoint: /worker-entrypoint.sh + healthcheck: + test: php artisan horizon:status | grep running + interval: 60s + timeout: 5s + retries: 1 + + schedule: + image: "quay.io/zknt/pixelfed:dev" + restart: "unless-stopped" + networks: + back: {} + depends_on: + - redis + - app + env_file: + - ./env + volumes: + - "./data/storage:/var/www/storage" + - "./env:/var/www/.env" + entrypoint: /schedule-entrypoint.sh + + redis: + image: "docker.io/library/redis" + restart: "unless-stopped" + volumes: + - "./data/redis:/data" + networks: + - back +``` + +For an example env file please see +[the example in pixelfeds github repo](https://github.com/pixelfed/pixelfed/blob/dev/.env.docker). + +`app` and `websockets` services reference a opcache config file, which looks +like this for my box: + +```ini +[opcache] +opcache.enable=1 +opcache.revalidate_freq=0 +opcache.validate_timestamps=0 +opcache.max_accelerated_files=10000 +opcache.memory_consumption=192 +opcache.max_wasted_percentage=10 +opcache.interned_strings_buffer=16 +opcache.fast_shutdown=1 +``` + +And last but not least, if you don't use my image, these are the main commands from +my entrypoint scripts. See [my git](https://git.zknt.org/dockers/pixelfed) for the +full scripts. + +* Worker container gets started with: `php artisan horizon` +* Websockets container gets started with: `php artisan websockets:serve` +* Scheduler container gets started with: `php artisan schedule:work`