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
- 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
andGID
) - Use of environment variables to set various configuration elements, for easier integration with other containers without modifying configuration files
DIASPORA_VER
: Diaspora version (0.7.12.0
)GID
: group id (default:942
)UID
: user id (default:942
)
/diaspora/public
: location of the assets and user uploads
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 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 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:
DB_TYPE
: database type. Set topostgresql
(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)
DB_TYPE
: database type. Set tomysql
(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)
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.
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.