summaryrefslogtreecommitdiff
path: root/packaging/docker-alpine/build-files/anastasis-entrypoint.sh
blob: ec727167fae0e494a65b85e6f14d904f64b3324c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env sh
set -e

if ! [ -d "/etc/anastasis" ]; then
  echo -e "
\x1b[0;31;1mFATAL\x1b[0m Anastasis-Docker needs /etc/anastasis mounted.
      If you're calling docker directly, pass '-v ./anastasis-config:/etc/anastasis' to docker run
      If you're using a docker compose, add the below to the service:
        volumes:
          - ./anastasis-config:/etc/anastasis:rw" 1>&2;
  exit 1;
fi;
if ! [ -f "/etc/anastasis/anastasis.conf" ]; then
  echo -e "\x1b[0;33;1mWARN\x1b[0m Anastasis-Docker needs /etc/anastasis/anastasis.conf.
     If you're seeing this for the first time after setting up a volume binding, simply continue by modifying your config. A config was just created for you! :)
     Otherwise, see below for information on adding a volume binding:
       If you're calling docker directly, pass '-v ./anastasis-config:/etc/anastasis' to docker run
       If you're using a docker compose, add the below to the service:
        volumes:
          - ./anastasis-config:/etc/anastasis:rw" 1>&2;
  echo '[anastasis]
SERVE = tcp
PORT = 9977
DB = postgres

[stasis-postgres]
CONFIG = postgres://admin:password@172.168.111.10:5432/postgres
' > /etc/anastasis/anastasis.conf
fi;

set -ax

anastasis-dbinit -c /etc/anastasis/anastasis.conf
anastasis-httpd -c /etc/anastasis/anastasis.conf $@