GithubHelp home page GithubHelp logo

janjastrow / docker-pleroma Goto Github PK

View Code? Open in Web Editor NEW

This project forked from angristan/docker-pleroma

0.0 1.0 0.0 21 KB

Docker image for the Pleroma federated social network

Home Page: https://git.pleroma.social/pleroma/pleroma/

License: MIT License

Dockerfile 100.00%

docker-pleroma's Introduction

Pleroma

Pleroma is a federated social networking platform, compatible with GNU social and other OStatus implementations. It is free software licensed under the AGPLv3.

It actually consists of two components: a backend, named simply Pleroma, and a user-facing frontend, named Pleroma-FE.

Its main advantages are its lightness and speed.

Pleroma

Pleromians trying to understand the memes

Features

  • Based on the elixir:alpine image
  • Ran as an unprivileged user
  • It works great

Sadly, this is not a reusable (e.g. I can't upload it to the Docker Hub), because for now Pleroma needs to compile the configuration. ๐Ÿ˜ข Thus you will need to build the image yourself, but I explain how to do it below.

Build-time variables

  • PLEROMA_VER : Pleroma version (latest commit of the develop branch by default)
  • GID: group id (default: 911)
  • UID: user id (default: 911)

Usage

Installation

Create a folder for your Pleroma instance. Inside, you should have Dockerfile and docker-compose.yml from this repo.

Here is the docker-compose.yml. You should change the POSTGRES_PASSWORD variable.

version: '2.3'

services:
  postgres:
    image: postgres:9.6-alpine
    container_name: pleroma_postgres
    restart: always
    environment:
      POSTGRES_USER: pleroma
      POSTGRES_PASSWORD: pleroma
      POSTGRES_DB: pleroma
    volumes:
      - ./postgres:/var/lib/postgresql/data

  web:
    build: .
    image: pleroma
    container_name: pleroma_web
    restart: always
    ports:
      - '127.0.0.1:4000:4000'
    volumes:
      - ./uploads:/pleroma/uploads
    depends_on:
      - postgres

Create the upload and config folder and give write permissions for the uploads:

mkdir uploads config
chown -R 911:911 uploads

Pleroma needs the citext PostgreSQL extension, here is how to add it:

docker-compose up -d postgres
docker exec -i pleroma_postgres psql -U pleroma -c "CREATE EXTENSION IF NOT EXISTS citext;"
docker-compose down

Configure Pleroma. Copy the following to config/secret.exs:

use Mix.Config

config :pleroma, Pleroma.Web.Endpoint,
   http: [ ip: {0, 0, 0, 0}, ],
   url: [host: "pleroma.domain.tld", scheme: "https", port: 443],
   secret_key_base: "<use 'openssl rand -base64 48' to generate a key>"

config :pleroma, :instance,
  name: "Pleroma",
  email: "[email protected]",
  limit: 5000,
  registrations_open: true

config :pleroma, :media_proxy,
  enabled: false,
  redirect_on_failure: true,
  base_url: "https://cache.domain.tld"

# Configure your database
config :pleroma, Pleroma.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "pleroma",
  password: "pleroma",
  database: "pleroma",
  hostname: "postgres",
  pool_size: 10

You need to change at least:

  • host
  • secret_key_base
  • email

Make sure your PostgreSQL parameters are ok.

You can now build the image. 2 way of doing it:

docker-compose build
# or
docker build -t pleroma .

I prefer the latter because it's more verbose.

Setup the database:

docker-compose run --rm web mix ecto.migrate

Get your web push keys and copy them to secret.exs:

docker-compose run --rm web mix web_push.gen.keypair

You will need to build the image again, to pick up your updated secret.exs file:

docker-compose build
# or
docker build -t pleroma .

You can now launch your instance:

docker-compose up -d

Check if everything went well with:

docker logs -f pleroma_web

You can now setup a Nginx reverse proxy in a container or on your host by using the example Nginx config.

Update

By default, the Dockerfile will be built from the latest commit of the develop branch.

If you want to run a specific commit, you can use the PLEROMA_VER variable:

docker build -t pleroma . --build-arg PLEROMA_VER=develop # a branch
docker build -t pleroma . --build-arg PLEROMA_VER=a9203ab3 # a commit
docker build -t pleroma . --build-arg PLEROMA_VER=v2.0.7 # a version

To update, just rebuild your image and recreate your containers:

docker-compose pull # update the PostgreSQL if needed
docker-compose build .
# or
docker build -t pleroma .
docker-compose run --rm web mix ecto.migrate # migrate the database if needed
docker-compose up -d # recreate the containers if needed

a9203ab3 being the hash of the commit. (They're here)

Other Docker images

Here are other Pleroma Docker images that helped me build mine:

docker-pleroma's People

Contributors

angristan avatar captainbeyondds8 avatar dependabot[bot] avatar fusion avatar janjastrow avatar skyleite avatar waylon531 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.