-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
60 lines (43 loc) · 1.59 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Build Service Node
FROM debian:buster-slim as mentat-node-builder
ARG SERVICE="rosetta-snarkos"
ARG BRANCH="main"
RUN mkdir -p /app \
&& chown -R nobody:nogroup /app
WORKDIR /app
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y curl
RUN curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/monadicus/mentat/$BRANCH/$SERVICE/install.sh | bash
# Build Rosetta Mentat
FROM debian:buster-slim as rosetta-mentat-builder
ARG SERVICE="rosetta-snarkos"
ARG BRANCH="main"
RUN mkdir -p /app \
&& chown -R nobody:nogroup /app
WORKDIR /app
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y curl clang gcc git
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN git clone -b $BRANCH https://github.com/monadicus/mentat.git \
&& cd mentat \
&& cargo build --release --bin "$SERVICE" \
&& mv ./target/release/"$SERVICE" /app
## Build Final Image
FROM debian:buster-slim
ARG SERVICE="rosetta-snarkos"
ENV ROCKET_ENV "production"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y git
RUN mkdir -p /app \
&& chown -R nobody:nogroup /app \
&& mkdir -p /data \
&& chown -R nobody:nogroup /data
WORKDIR /app
# Copy binary from mentat-node-builder
COPY --from=mentat-node-builder /app/node-runner /app/node-runner
# Copy binary from rosetta-mentat-builder
COPY --from=rosetta-mentat-builder /app/$SERVICE /app/rosetta-mentat-service
# Set permissions for everything added to /app
RUN chmod -R 755 /app/*
CMD ["/app/rosetta-mentat-service"]