Skip to content

Commit

Permalink
added standalone node type
Browse files Browse the repository at this point in the history
  • Loading branch information
iDmple committed Feb 24, 2024
1 parent 25246b5 commit ee6caed
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
POSTGRES_USER="<user>"
POSTGRES_PASSWORD="<pass>"
POSTGRES_DB="<db>"
POSTGRES_DB_STANDALONE="<db>"
GF_SECURITY_ADMIN_USER="<gf_user>"
GF_SECURITY_ADMIN_PASSWORD="<gf_pass>"
44 changes: 29 additions & 15 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,35 @@ services:
# profiles: ["broker"]
# restart: always

#postgres:
# image: postgres:16.1
# container_name: postgres
# hostname: postgres
# env_file:
# - .env
# volumes:
# - ./data:/var/lib/postgresql/data
# profiles: ["broker"]
# restart: always
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
# interval: 10s
# timeout: 5s
# retries: 5
unchained_standalone:
image: ghcr.io/kenshitech/unchained:latest
container_name: unchained_standalone
hostname: unchained_standalone
volumes:
- ./conf.standalone.yaml:/app/conf.yaml
depends_on:
postgres:
condition: service_healthy
environment:
- UNCHAINED_NODE_TYPE=standalone
profiles: ["standalone"]
restart: always

postgres:
image: postgres:16.1
container_name: postgres
hostname: postgres
env_file:
- .env
volumes:
- ./data:/var/lib/postgresql/data
profiles: ["standalone"]
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB_STANDALONE"]
interval: 10s
timeout: 5s
retries: 5

#grafana:
# image: grafana/grafana-oss:latest
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ echo "Running a $UNCHAINED_NODE_TYPE node."
# fi
#fi

./unchained $UNCHAINED_NODE_TYPE -c conf/conf.$UNCHAINED_NODE_TYPE.yaml -s conf/secrets.$UNCHAINED_NODE_TYPE.yaml -x context
./unchained $UNCHAINED_NODE_TYPE -c conf/conf.$UNCHAINED_NODE_TYPE.yaml -s conf/secrets.$UNCHAINED_NODE_TYPE.yaml -x context/$UNCHAINED_NODE_TYPE
7 changes: 4 additions & 3 deletions docker/unchained.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ usage() {
echo "Usage: $0 [node] [options]"
echo "Node:"
#echo " broker - Manage unchained broker node"
#echo " remote - Manage unchained remote node"
echo " worker - Manage unchained worker node"
#echo " remote - Manage unchained remote node"
echo " worker - Manage unchained worker node"
echo " standalone - Manage unchained standalone node"
echo "Options:"
echo " Additional options passed directly to 'docker compose'"
echo "Examples:"
Expand All @@ -29,7 +30,7 @@ if ! docker compose version &>/dev/null; then
exit 1
fi

if [ ! $1 == 'worker' ]; then #&& [ ! $1 == 'remote' ] && [ ! $1 == 'lite' ] || [ -z $2 ]; then
if [ ! $1 == 'worker' ] && [ ! $1 == 'standalone' ]; then #&& [ ! $1 == 'remote' ] && [ ! $1 == 'lite' ] || [ -z $2 ]; then
usage
exit 1
fi
Expand Down

0 comments on commit ee6caed

Please sign in to comment.