Skip to content

Commit

Permalink
harmonize directory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed Jan 5, 2024
1 parent e3fca93 commit 6ad1dce
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
apt-get install --no-install-recommends -y \
libgoogle-perftools4 \
wget && \
useradd -m -r -u $UID -d /home/dockeruser dockeruser && \
useradd -m -r -u $UID -d /opt/graphsense dockeruser && \
mkdir -p /opt/graphsense/data && \
chown -R dockeruser /opt/graphsense
RUN wget https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.7.3/FullNode.jar -O /home/dockeruser/FullNode.jar && \
chown dockeruser:dockeruser /home/dockeruser/FullNode.jar
chown -R dockeruser /opt/graphsenseq

USER dockeruser
RUN wget https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.7.3/FullNode.jar -O /opt/graphsense/FullNode.jar
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4"
ENV TCMALLOC_RELEASE_RATE=10
ADD conf/main_net_config.conf /opt/graphsense/client.conf
ADD logback.xml /opt/graphsense/logback.xml
WORKDIR /home/dockeruser
WORKDIR /opt/graphsense

CMD ["java", "-Xmx24g", "-XX:+UseConcMarkSweepGC", "-jar", "FullNode.jar", "-c", "/opt/graphsense/client.conf", "--output-directory", "/opt/graphsense/data", "--log-config", "/opt/graphsense/logback.xml"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Client data is persisted on the host machine using a Docker volume.
In the default setting the local directory `./data` is mapped to
to `/opt/graphsense/data` inside the container.
Logs are stored in the log directory created by the tron client
which resides in `/home/dockeruser/logs` and is by default mapped
which resides in `/opt/graphsense/logs` and is by default mapped
to `./logs/`. To override these settings
a Docker Compose override file can be used, e.g.

Expand All @@ -31,10 +31,10 @@ services:
tron-client:
volumes:
- ./data:/opt/graphsense/data
- ./logs:/home/dockeruser/logs
- ./logs:/opt/graphsense/logs
```

The data directory on the host system must be writeable by user `dockeruser`.
The data directory on the host system must be writeable by user `dockeruser`. To provide your own customized java-tron config, just map it at ```/opt/graphsense/client.conf```.

## Usage

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ services:
dockerfile: ./Dockerfile
volumes:
- ./data/:/opt/graphsense/data:Z
- ./conf/main_net_config.conf:/opt/graphsense/client2.conf:Z
- ./logs/:/home/dockeruser/logs:Z
- ./conf/main_net_config.conf:/opt/graphsense/client.conf:Z
- ./logs/:/opt/graphsense/logs:Z
ports:
- 50545:50545
- 50555:50555
Expand Down

0 comments on commit 6ad1dce

Please sign in to comment.