Update Dockerfile to install libsnappy-dev and to use current source code

Also, update Docker usage documentation.
This commit is contained in:
Roman Zeyde 2019-03-02 21:36:13 +02:00
parent 77ee699ed5
commit bb8baf4108
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB
3 changed files with 12 additions and 7 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
target/
.git/
_*/

View file

@ -1,14 +1,17 @@
FROM rust:latest
FROM rust:1.33.0-slim
RUN apt-get update
RUN apt-get install -y clang cmake
RUN cargo install electrs
RUN apt-get install -y libsnappy-dev
RUN adduser --disabled-login --system --shell /bin/false --uid 1000 user
USER user
WORKDIR /home/user
COPY ./ /home/user
RUN cargo build --release
RUN cargo install --path .
# Electrum RPC
EXPOSE 50001
@ -17,5 +20,3 @@ EXPOSE 50001
EXPOSE 4224
STOPSIGNAL SIGINT
CMD ["electrs", "-vvvv", "--timestamp"]

View file

@ -122,9 +122,10 @@ $ electrum --oneserver --server=example:50002:s
```bash
$ docker build -t electrs-app .
$ docker run --network host \
--volume /home/roman/.bitcoin:/home/user/.bitcoin:ro \
--volume $HOME/.bitcoin:/home/user/.bitcoin:ro \
--volume $PWD:/home/user \
--rm -i -t electrs-app
--rm -i -t electrs-app \
electrs -vvvv --timestamp --db-dir /home/user/db
```
## Monitoring