Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

A Docker image for the Diaspora* federated social network

License

Notifications You must be signed in to change notification settings

nikkoura/docker-diaspora

 
 

Repository files navigation

Diaspora*

Diaspora Logo

Diaspora is a nonprofit, user-owned, distributed social network that is based upon the free Diaspora software. Diaspora consists of a group of independently owned nodes (called pods) which interoperate to form the network.

Automated build of the image can be found on the Docker Hub.

Forked from ultrahang/docker-diaspora

Features

  • Based on the official ruby:2.4-slim-stretch image
  • Running the latest stable version of diaspora/diaspora
  • Run as an unprivileged user (see UID and GID)
  • Use of environment variables to set various configuration elements, for easier integration with other containers without modifying configuration files

Build-time variables

  • DIASPORA_VER: Diaspora version (0.7.12.0)
  • GID: group id (default: 942)
  • UID: user id (default: 942)

Volumes

  • /diaspora/public: location of the assets and user uploads

Usage

Run-time environment variables

Base settings

See comments in config/diaspora.yml for the possible environment variables. Here are the critical ones to integrate with the container environment:

  • ENVIRONMENT_URL: diaspora public URL. Do not modify once db has been populated (optional, default= http://localhost)
  • SERVER_LISTEN: Diaspora 'unicorn' server listener (default= 0.0.0.0:3000)

REDIS Access

REDIS access can be specified in two ways:

  • By providing a complete connection URL, optionally including user/password : -- ENVIRONMENT_REDIS: REDIS url, (default= redis://redis)
  • By providing separate connection elements: -- REDIS_HOST: REDIS server, (default= redis) -- REDIS_USER: REDIS connection user, (optional, default empty) -- REDIS_PASSWORD: REDIS connection password, (optional, default empty)

Database access

Database configuration is templated using confd. Template and associated settings are available in this repository under /config and under /etc/confd in the container image. The following environment variables should be used depending on the db you are using:

PostgreSQL
  • DB_TYPE: database type. Set to postgresql (mandatory)
  • DB_HOST: db server host (optional, default= postgres)
  • DB_PORT: db server port (optional, default= 5432)
  • DB_USER: db server user (optional, default= empty)
  • DB_PASSWORD: db server password (optional, default= empty)
MySQL
  • DB_TYPE: database type. Set to mysql (mandatory)
  • DB_HOST: db server host (optional, default= mysql)
  • DB_PORT: db server port (optional, default= 3306)
  • DB_USER: db server user (optional, default= empty)
  • DB_PASSWORD: db server password (optional, default= empty)

Docker Compose

A sample Docker Compose file is provided. It instanciates standalones instances of PostreSQL and REDIS, and a NGinx web server to serve static elements (assets and user uploads). It can be used for a basic deployment, with minor modifications to environment variables.

We need a Nginx container to server the uploads and assets, as Unicorn doesn't do it.

Installation

When running the instance for the first time, run this command to initialize the postgres instance:

docker-compose up -d postgres

Allow a few minutes for the instance to initialize and settle, then create the schema:

docker-compose run --rm unicorn initdb

Then compile the assets:

docker-compose run --rm unicorn precompile-assets

You can now lauch your pod!

docker-compose up -d

You can check your Diaspora installation on the http://localhost with no modification on the configuration files. To set the administrator account follow the Official FAQ instructions after creating an account on the site.

About

A Docker image for the Diaspora* federated social network

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 80.6%
  • Shell 19.4%