Skip to content

Commit

Permalink
Merge pull request #4 from karma-coin/dockerfile
Browse files Browse the repository at this point in the history
Dockerfile
  • Loading branch information
avive authored Aug 31, 2023
2 parents 879b271 + 6005e78 commit 4a8446c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.devcontainer
.github
.vscode
scripts
target
config.yaml
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM rust:1.67.0-slim-buster AS builder

RUN apt update \
&& apt install -y libssl-dev pkg-config protobuf-compiler openssl ca-certificates \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY ./ ./karmacoin-verifier
RUN cd /karmacoin-verifier
WORKDIR /karmacoin-verifier

RUN cargo build --release -p server-app
RUN mkdir /out && cp target/release/server-app ../out/server-app

FROM debian:stable-20210902-slim AS runtime

RUN apt update && apt install curl net-tools -y

COPY --from=builder /out/ /

EXPOSE 9080 9080

ENTRYPOINT ["/server-app"]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ Xactor (unlike Actix) gives us nice and clean async syntax for actor messages. H
- `server` - Server implementation.
- `server-app` - Simple console server app.

### Docker
To build docker image

```bash
docker build . -t karmacoin-verifier
```

To use configuration file from host machine, mount it to `/config.yaml` inside the container. And than run the container. Both actions can be done with the following command:

```bash
docker run -d -p 9080:9080 --name karmacoin-verifier --mount type=bind,source="$(pwd)"/config.yaml,target=/config.yaml karmacoin-verifier
```

---

Copyright (c) 2023 by the KarmaCoin Authors. This work is licensed under the [KarmaCoin License](https://github.com/karma-coin/.github/blob/main/LICENSE).
Expand Down

0 comments on commit 4a8446c

Please sign in to comment.