forked from Cybersecurity-LINKS/trust-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (25 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ---------------------------------------------------
# 1 - Build Stage
# ---------------------------------------------------
FROM rustlang/rust:nightly-alpine AS build
WORKDIR /usr/src/app
COPY . .
# COPY .env .env
# COPY .mongo.env .mongo.env
RUN apk add --no-cache make musl-dev clang llvm gcc libc-dev clang-dev binutils g++ linux-headers libstdc++ libgcc libressl-dev
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN cd abigen \ \
&& cargo run -- --contract AssetFactory --abi-source "../smart-contracts/AssetFactory.json" \
&& cargo run -- --contract Asset --abi-source "../smart-contracts/Asset.json" \
&& cd ..
RUN cargo install --path ./actix-server
# ---------------------------------------------------
# 2 - Deploy Stage
# ---------------------------------------------------
FROM alpine:latest
RUN apk add --no-cache make musl-dev clang llvm gcc libc-dev clang-dev binutils g++ linux-headers libstdc++ libgcc libressl-dev
COPY --from=build /usr/local/cargo/bin/actix-trust-service /usr/local/bin/actix-trust-service
COPY --from=build /usr/src/app/actix-server/.env /.env
COPY --from=build /usr/src/app/actix-server/.mongo.env /.mongo.env
EXPOSE 8081
ENTRYPOINT [ "actix-trust-service" ]