Skip to content
Snippets Groups Projects
Commit 3d30108d authored by Gilles Filippini's avatar Gilles Filippini
Browse files

build: docker image and compose file

parent fb75bca5
No related branches found
No related tags found
1 merge request!7build: docker image and compose file
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
.dockerignore 0 → 100644
Dockerfile
docker-compose.yml
Dockerfile 0 → 100644
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
FROM alpine as build
RUN apk update && \
apk add ca-certificates curl && \
update-ca-certificates && \
apk add --update \
cmake \
make \
pkgconfig \
gcc \
g++ \
musl-dev \
linux-headers \
protoc \
openssl-dev \
clang-dev
# install latest stable rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
# Copy source tree
COPY . .
# build duniter
ARG threads=1
RUN source ~/.cargo/env && \
RUSTFLAGS="-C target-feature=-crt-static" \
cargo build --release -j $threads
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM alpine
LABEL maintainer="Gilles Filippini <gilles.filippini@pini.fr>"
LABEL version="0.0.0"
LABEL description="POC for a Substrate based Libre Currency implementation (https://libre-currency.org/)"
# Dependancies
RUN apk update && \
apk add libstdc++
# Intall
COPY --from=build /target/release/lc-core /usr/local/bin/lc-core
COPY docker-entrypoint /usr/local/bin/
# Configuration
EXPOSE 9944
VOLUME /var/lib/lc-core
ENTRYPOINT ["docker-entrypoint"]
version: "3.2"
services:
dev:
dunter-v2s:
container_name: duniter-v2s
image: paritytech/ci-linux:974ba3ac-20201006
working_dir: /var/www/node-template
image: duniter-v2s
ports:
- "9944:9944"
- "127.0.0.1:9944:9944"
environment:
- CARGO_HOME=/var/www/node-template/.cargo
DUNITER_INSTANCE_NAME: "my_instance"
volumes:
- .:/var/www/node-template
- type: bind
source: ./.local
target: /root/.local
command: bash -c "cargo build && ./target/debug/node-template --dev --ws-external"
- data:/var/lib/lc-core
volumes:
data:
#!/bin/sh
if [ -n "$DUNITER_INSTANCE_NAME" ]; then
set -- "$@" --name "$DUNITER_INSTANCE_NAME"
fi
exec lc-core --dev --no-prometheus --ws-external -d /var/lib/lc-core "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment