Skip to content

Commit

Permalink
Merge pull request #323 from steemit/redis-conf-update
Browse files Browse the repository at this point in the history
update docker-compose.yaml about redis config
  • Loading branch information
yuekun0707 authored Dec 5, 2023
2 parents aa42d0a + 79f573e commit 9ee7c49
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,9 @@ tests/failed_blocks/
/deploy/
/scripts/hive.sqlite
.vscode

# docker
redis_data/*
postgres_data/*
!redis_data/.gitkeep
!postgres_data/.gitkeep
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ docker logs -f hivemind
| `HTTP_SERVER_PORT` | `--http-server-port` | 8080 |
| `DATABASE_URL` | `--database-url` | postgresql://user:pass@localhost:5432/hive |
| `STEEMD_URL` | `--steemd-url` | https://api.steemit.com |
| `REDIS_URL` | `--redis-url` | redis://localhost:6379/ |
| `MAX_BATCH` | `--max-batch` | 50 |
| `MAX_WORKERS` | `--max-workers` | 4 |
| `TRAIL_BLOCKS` | `--trail-blocks` | 2 |
Expand Down
11 changes: 7 additions & 4 deletions dev_env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#/bin/bash

set -xe

container_name=dev-hivemind-env

run() {
Expand All @@ -10,16 +12,16 @@ run() {
tag=dev-env
fi

if [ -n ${network} ]; then
network_str="--network ${network}"
if [ "${network}" = "" ]; then
network=bridge
fi

docker run -it --rm \
docker run -itd --rm \
--name ${container_name} \
-v $(pwd):/project \
--env-file $(pwd)/.env \
--workdir /project \
${network_str} \
--network ${network} \
steemit/hivemind:${tag} \
/bin/bash
}
Expand All @@ -40,6 +42,7 @@ main_func() {
case ${op} in
run)
run $tag $network
cli
;;
cli)
cli
Expand Down
20 changes: 13 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@ services:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testuserpass
POSTGRES_DB: testdb
ports:
- 3306:3306
volumes:
- ./postgres_data:/var/lib/postgresql/data
restart: always
redis:
image: redis
volumes:
- ./redis_data:/data
restart: always
hive:
depends_on:
- db
image: steemit/hive
build: .
- redis
image: steemit/hivemind:latest
environment:
DATABASE_URL: postgresql://testuser:testuserpass@db:5432/testdb
LOG_LEVEL: INFO
DATABASE_URL: postgresql://testuser:testuserpass@db:5432/testdb
STEEMD_URL: https://api.steemit.com
REDIS_URL: redis://redis:6379
links:
- db:db
- redis:redis
ports:
- 8080:8080
volumes:
- .:/app
restart: always
Empty file added postgres_data/.gitkeep
Empty file.
Empty file added redis_data/.gitkeep
Empty file.

0 comments on commit 9ee7c49

Please sign in to comment.