Commit a3ddfb12 authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files

docker-compose.yml added, README updated

parent cea336de
......@@ -2,6 +2,39 @@
This is a dockerized [Uniqush](https://uniqush.org/) setup. This [Debian](https://www.debian.org/)-based image only contains Uniqush -- as per docker philosophy, a `redis` server has to be run separately; the [`redis` docker image](https://hub.docker.com/_/redis/) might be a good choice.
## Running using `docker-compose`
An example `docker-compose.yml` file is provided, allowing to run a complete setup (Uniqush, Redis) with a single infocation of:
```
docker-compose up
```
You should see output that contains an IP address of the Uniqush container, for example:
```
uniqush_1 | +-- IP addresses of the container:
uniqush_1 | 172.22.0.3
```
You can verify that `uniqush-push` is running by pointing your web browser at `http://172.22.0.3:9898/version`. You should see something like:
```
uniqush-push 2.1.0
```
Connection to Redis database can be verified by pointing the browser at `http://172.22.0.3:9898/psps`. The expected output is:
```
{"services":{},"code":"UNIQUSH_SUCCESS"}
```
If you get output as below, it means that the Redis database is not available:
```
{"services":{},"errorMsg":"GetServiceNames: Could not get services from redis: dial tcp: lookup redis on 8.8.8.8:53: no such host","code":"UNIQUSH_ERROR_DATABASE"}
```
## Configuration and operation
By default `$UNIQUSH_USER` is created with with `$UNIQUSH_UID` (if provided), in `$UNIQUSH_GROUP` with `$UNIQUSH_GID` (if provided); `/usr/bin/uniqush-push` daemon is then run as this user and group.
......
version: "2"
services:
uniqush:
build:
context: ./
environment:
# this is the default, but let's be explicit here
UNIQUSH_DATABASE_HOST: "redis"
depends_on:
- redis
redis:
image: redis
\ No newline at end of file
......@@ -189,6 +189,10 @@ else
echo "+-- config file found in '$UNIQUSH_CONFIG_PATH', ignoring \$UNIQUSH_WEBFRONTEND_ADDR, \$UNIQUSH_DATABASE_*, \$UNIQUSH_LOG* envvars"
fi
# get the IP addresses of the container
echo "+-- IP addresses of the container:"
ip -4 addr show scope global | grep inet | sed -r -e 's%inet.? (.+)/[0-9]{2,}.+%\1%'
# start the darn thing
echo "+-- executing as user $UNIQUSH_USER:"
echo " $*"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment