-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (33 loc) · 1.37 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
FROM rust:1.67 AS builder
# Install the required dependencies
RUN apt-get update && apt-get install -y curl gnupg
# Install Node.js LTS
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install the latest Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn-keyring.gpg >/dev/null
RUN echo "deb [signed-by=/usr/share/keyrings/yarn-keyring.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
RUN rustup target add wasm32-unknown-unknown
RUN cargo install cargo-make
RUN cargo install wasm-pack
WORKDIR /usr/src/zk-wordle
COPY ./Cargo.* ./*.toml ./
COPY ./backend ./backend
COPY ./contract ./contract
COPY ./core ./core
COPY ./frontend ./frontend
COPY ./methods ./methods
COPY ./wasm-verifier ./wasm-verifier
RUN cargo make build
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y nginx-light ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/zk-wordle
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/src/zk-wordle/target/release/backend ./target/release/backend
COPY --from=builder /usr/src/zk-wordle/frontend/dist /var/www/html
EXPOSE 8080
ENTRYPOINT nginx && /usr/src/zk-wordle/target/release/backend