computer-playbook/roles/server_docker-pixelfed
2023-06-29 14:50:38 +02:00
..
handlers Refactored docker roles 2023-04-26 11:52:11 +02:00
meta Renamed server roles 2023-04-18 15:41:14 +02:00
tasks solved docker-compose naming bugs 2023-04-19 00:03:13 +02:00
templates Changed mysql to mariadb 2023-06-21 12:56:28 +02:00
vars Refactored docker roles 2023-04-26 11:52:11 +02:00
README.md Optimized pixelfed README.md file with ChatGPT 2023-06-29 14:50:38 +02:00

Pixelfed Docker Server Role

This README details the steps to manage your Pixelfed instance running in a Docker container. This setup is part of the server_docker-pixelfed role within Kevin Veen-Birkenbach's computer-playbook located at this GitHub repository.

Accessing Services

Application Access

To gain shell access to the application container, run the following command:

docker-compose exec -it application bash

Database Access

To access the MariaDB instance in the database container, run the following command:

docker-compose exec -it database mariadb -u pixelfed -p

Instagram Import Cleanup

If you have imported posts from Instagram, you can clean up the imported data and files as follows:

Database Cleanup

Run these commands inside your MariaDB shell to remove import related data:

DELETE from import_posts WHERE 1;
DELETE from import_jobs WHERE 1;
DELETE from import_datas WHERE 1;
DELETE from statuses where created_at < "2022-12-01 22:15:39";
DELETE from media where deleted_at >= "2023-07-28 14:39:05";

File System Cleanup

Run these commands to remove the imported files and trigger the cleanup job:

docker-compose exec -u "www-data" application rm -rv "/var/www/storage/app/imports/1"
docker-compose exec -u "www-data" application php artisan schedule:run

Full Cleanup (Reset)

For a hard reset, which will delete all data and stop all services, use the following commands:

docker-compose down
docker volume rm pixelfed_application_data pixelfed_database pixelfed_redis_data

Update Procedure

To update your Pixelfed instance, navigate to the directory where your docker-compose.yml file is located and run these commands:

cd {{path_docker_compose_files}}pixelfed/ &&
docker-compose down &&
docker network prune -f &&
docker-compose pull &&
docker-compose build &&
docker-compose -p pixelfed up -d --force-recreate

Inspecting the Services

To see the status of all services or follow the logs, use these commands:

docker-compose ps -a
docker-compose logs -f

Further Reading

For additional information, refer to these resources:

Author: Kevin Veen-Birkenbach, https://www.veen.world, kevin@veen.world

This README was optimized with the help of OpenAI's ChatGPT. You can view the conversation here.