2018-06-03 22:11:12 +00:00
# Pleroma-Docker (Unofficial)
2018-04-08 20:49:07 +00:00
[Pleroma ](https://pleroma.social/ ) is a selfhosted social network that uses OStatus/ActivityPub.
2018-06-03 22:11:12 +00:00
This repository dockerizes it for easier deployment.
< hr >
```cpp
2018-12-28 01:05:31 +00:00
#include <LICENSE>
2018-06-03 22:11:12 +00:00
/*
* This repository comes with ABSOLUTELY NO WARRANTY
*
2019-08-25 22:07:59 +00:00
* I will happily help you with issues related to this script,
* but I am not responsible for burning servers, angry users, fedi drama,
2019-01-10 00:06:29 +00:00
* thermonuclear war, or you getting fired because your boss saw your NSFW posts.
2019-08-25 22:07:59 +00:00
*
* Please do some research if you have any concerns about the
* included features or software ** *before*** using it.
2019-01-10 00:06:29 +00:00
*
2018-06-03 22:11:12 +00:00
*/
```
< hr >
2018-04-08 20:49:07 +00:00
2019-04-11 23:14:25 +00:00
## In the Wild
2021-03-25 10:08:09 +00:00
`cofe.rocks` is always managed by this script.
2020-05-03 14:31:53 +00:00
Take a look at [hosted/pleroma ](/hosted/pleroma ) if you get stuck or need some inspiration.
2019-04-11 23:14:25 +00:00
2021-03-25 10:08:09 +00:00
Additionally it's known to run on (in no particular order):
- social.interhop.org
- social.technodruide.ca
- toot.poto.cafe
2020-05-03 14:33:01 +00:00
Does your instance use pleroma-docker?
2019-04-11 23:14:25 +00:00
Let me know and I'll add you to this list.
2018-04-08 20:49:07 +00:00
2018-12-28 01:05:31 +00:00
## Docs
2018-04-08 20:49:07 +00:00
2019-04-11 23:26:21 +00:00
These docs assume that you have at least a basic understanding
of the pleroma installation process and common docker commands.
2020-05-03 14:33:01 +00:00
If you have questions about Pleroma head over to https://docs.pleroma.social/.
2019-04-11 23:26:21 +00:00
For help with docker check out https://docs.docker.com/.
2019-08-25 16:44:49 +00:00
For other problems related to this script, contact me or open an issue :)
2019-01-10 00:27:52 +00:00
### Prerequisites
2019-08-25 21:59:29 +00:00
- ~1GB of free HDD space
2019-04-11 23:14:25 +00:00
- `git` if you want smart build caches
2019-08-25 16:44:49 +00:00
- `curl` , `jq` , and `dialog` if you want to use `./pleroma.sh mod`
- Bash 4+
2019-04-11 23:14:25 +00:00
- Docker 18.06+ and docker-compose 1.22+
2019-01-10 00:27:52 +00:00
2019-01-10 00:06:29 +00:00
### Installation
2018-04-08 20:49:07 +00:00
2018-06-03 22:11:12 +00:00
- Clone this repository
2019-01-10 00:27:52 +00:00
- Create a `config.exs` and `.env` file
2019-08-25 16:44:49 +00:00
- Run `./pleroma.sh build` and `./pleroma.sh up`
2019-08-25 21:41:08 +00:00
- [Configure a reverse-proxy ](#my-instance-is-up-how-do-i-reach-it )
2018-04-08 20:49:07 +00:00
- Profit!
2020-05-03 14:33:01 +00:00
Hint:
You can also use normal `docker-compose` commands to maintain your setup.
2019-08-25 16:44:49 +00:00
The only command that you cannot use is `docker-compose build` due to build caching.
2019-08-25 21:59:29 +00:00
### Configuration
All the pleroma options that you usually put into your `*.secret.exs` now go into `config.exs` .
2020-05-03 14:33:01 +00:00
`.env` stores config values that need to be known at orchestration/build time.
2019-08-25 21:59:29 +00:00
Documentation for the possible values is inside of that file.
2019-01-10 00:06:29 +00:00
### Updates
2018-06-03 22:11:12 +00:00
2019-08-25 16:44:49 +00:00
Run `./pleroma.sh build` again and start the updated image with `./pleroma.sh up` .
2019-01-10 00:06:29 +00:00
You don't need to stop your pleroma server for either of those commands.
2018-04-08 20:49:07 +00:00
2019-01-10 00:06:29 +00:00
### Maintenance
2018-08-18 21:32:33 +00:00
2019-01-10 00:06:29 +00:00
Pleroma maintenance is usually done with mix tasks.
2019-08-25 16:44:49 +00:00
You can run these tasks in your running pleroma server using `./pleroma.sh mix [task] [arguments...]` .
2019-08-25 22:03:08 +00:00
For example: `./pleroma.sh mix pleroma.user new sn0w ...`
2019-08-25 22:02:45 +00:00
If you need to fix bigger problems you can also spawn a shell with `./pleroma.sh enter` .
2019-08-25 21:59:29 +00:00
### Customization
2020-05-03 14:33:01 +00:00
Add your customizations (and their folder structure) to `custom.d/` .
They will be copied into the right place when the container starts.
2019-08-25 21:59:29 +00:00
You can even replace/patch pleroma’ s code with this,
because the project is recompiled at startup if needed.
2020-05-03 14:33:01 +00:00
In general: Prepending `custom.d/` to pleroma’ s customization guides should work all the time.
2019-08-25 22:06:00 +00:00
Check them out in the [pleroma documentation ](https://docs.pleroma.social/small_customizations.html#content ).
2019-08-25 21:59:29 +00:00
2020-09-04 15:41:53 +00:00
For example: A custom thumbnail now goes into `custom.d/` + `instance/static/instance/thumbnail.jpeg` .
2019-08-25 21:59:29 +00:00
### Patches
Works exactly like customization, but we have a neat little helper here.
Use `./pleroma.sh mod [regex]` to mod any file that ships with pleroma, without having to type the complete path.
2019-08-25 16:44:49 +00:00
### My instance is up, how do I reach it?
2019-08-25 21:47:25 +00:00
To reach Gopher or SSH, just uncomment the port-forward in your `docker-compose.yml` .
2019-08-25 16:44:49 +00:00
2019-08-25 21:47:25 +00:00
To reach HTTP you will have to configure a "reverse-proxy".
2019-08-25 22:12:05 +00:00
Older versions of this project contained a huge amount of scripting to support all kinds of reverse-proxy setups.
2019-08-25 21:47:25 +00:00
This newer version tries to focus only on providing good pleroma tooling.
That makes the whole process a bit more manual, but also more flexible.
2020-05-03 14:33:01 +00:00
You can use Caddy, Traefik, Apache, nginx, or whatever else you come up with.
2019-08-25 16:44:49 +00:00
Just modify your `docker-compose.yml` accordingly.
One example would be to add an [nginx server ](https://hub.docker.com/_/nginx ) to your `docker-compose.yml` :
```yml
# ...
proxy:
image: nginx
init: true
restart: unless-stopped
links:
- server
volumes:
- ./my-nginx-config.conf:/etc/nginx/nginx.conf:ro
ports:
- "80:80"
- "443:443"
```
Then take a look at [the pleroma nginx example ](https://git.pleroma.social/pleroma/pleroma/blob/develop/installation/pleroma.nginx ) for hints about what to put into `my-nginx-config.conf` .
Using apache would work in a very similar way (see [Apache Docker Docs ](https://hub.docker.com/_/httpd ) and [the pleroma apache example ](https://git.pleroma.social/pleroma/pleroma/blob/develop/installation/pleroma-apache.conf )).
2020-05-03 14:33:01 +00:00
The target that you proxy to is called `http://server:4000/` .
2019-08-25 16:44:49 +00:00
This will work automagically when the proxy also lives inside of docker.
2018-08-18 21:32:33 +00:00
2019-08-25 21:47:25 +00:00
If you need help with this, or if you think that this needs more documentation, please let me know.
2019-08-25 16:44:49 +00:00
Something that cofe.rocks uses is simple port-forwarding of the `server` container to the host's `127.0.0.1` .
From there on, the natively installed nginx server acts as a proxy to the open internet.
2020-05-03 14:31:53 +00:00
You can take a look at cofe's [compose yaml ](/hosted/pleroma/src/branch/master/docker-compose.yml ) and [proxy config ](/hosted/pleroma/src/branch/master/proxy.xconf ) if that setup sounds interesting.
2019-08-25 16:44:49 +00:00
### Attribution
2019-04-11 23:26:21 +00:00
Thanks to [Angristan ](https://github.com/Angristan/dockerfiles/tree/master/pleroma ) and [RX14 ](https://github.com/RX14/kurisu.rx14.co.uk/blob/master/services/iscute.moe/pleroma/Dockerfile ) for their dockerfiles, which served as an inspiration for the early versions of this script.
2020-05-03 14:33:01 +00:00
The current version is based on the [offical install instructions ](https://docs.pleroma.social/alpine_linux_en.html ).
2019-04-11 23:26:21 +00:00
Thanks to all people who contributed to those.