-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
36 lines (24 loc) · 889 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
33
34
35
36
ARG node_base_image=node:20-slim
ARG rust_base_image=rust:1.73
FROM ${node_base_image} AS frontend
WORKDIR /app
COPY ./sponsoredTransactions/frontend ./
RUN corepack enable
RUN yarn
RUN yarn build
FROM ${rust_base_image} AS backend
WORKDIR /backend/app
COPY ./deps/concordium-rust-sdk /deps/concordium-rust-sdk
COPY ./sponsoredTransactions/backend ./
RUN cargo build --release
FROM ubuntu:22.04
WORKDIR /build
ENV PORT=8080
ENV NODE=http://node.testnet.concordium.com:20000
ENV LOG_LEVEL=info
ENV SMART_CONTRACT_INDEX=6372
ENV ACCOUNT_KEY_FILE=/KEY_FILE
COPY --from=backend ./backend/app/target/release/sponsored-transaction-backend ./main
COPY --from=frontend ./app/dist ./public
RUN chmod +x ./main
CMD ./main --node "${NODE}" --port "${PORT}" --account "${ACCOUNT_KEY_FILE}" --smart-contract-index "${SMART_CONTRACT_INDEX}" --log-level "${LOG_LEVEL}" --public-folder public