Skip to content

Commit

Permalink
add docker support (paritytech#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
prybalko authored Jun 20, 2022
1 parent 27486b8 commit 8726a08
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Local build artifacts
build
node_modules

# git folder
.git

# IDE files
.vscode
.idea

# Frontend files
src
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM rust:1.60

# Build time options to avoid dpkg warnings and help with reproducible builds.
ENV DEBIAN_FRONTEND=noninteractive \
CARGO_HOME="/app/target"

# Create CARGO_HOME folder and don't download rust docs
RUN mkdir -pv "${CARGO_HOME}" \
&& rustup set profile minimal

# Install system packages
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
libopencv-dev clang libclang-dev libssl-dev ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

ENTRYPOINT ["cargo", "run", "--release"]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ signer:

tests:
cargo test --release

docker.%:
docker-compose run --rm $(*)
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
_cli:
&cli
build: .
volumes:
- .:/app

collector:
<<: *cli
command: collect

updater:
<<: *cli
command: update
1 change: 1 addition & 0 deletions rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable

0 comments on commit 8726a08

Please sign in to comment.