-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
32 lines (26 loc) · 861 Bytes
/
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
29
30
31
32
FROM quay.io/tarilabs/rust:1.30-alpine as builder
# create a new empty shell project
RUN USER=root cargo new --bin bn-api
WORKDIR /bn-api
# Copy the dependency lists
ADD Cargo.lock ./
ADD Cargo.docker.toml ./Cargo.toml
# this build step will cache our dependencies
RUN cargo build --release
RUN rm src/*.rs
# Add the actual source code
ADD api ./api/
ADD db ./db/
ADD tari-client ./tari-client/
ADD stripe ./stripe/
ADD logging ./logging/
ADD Cargo.lock Cargo.toml ./
RUN cargo build --release
# Create a base minimal image for adding our executables to
FROM quay.io/tarilabs/run:alpine as base
# Now create a new image with only the essentials and throw everything else away
FROM base
COPY --from=builder /bn-api/target/release/server /usr/bin/
COPY --from=builder /bn-api/target/release/bndb_cli /usr/bin/
ADD reset-database.sh /usr/bin/
CMD ["server"]