Skip to content

Commit 242babb

Browse files
author
mike dupont
committed
wip
1 parent e58f1ad commit 242babb

File tree

2 files changed

+81
-6
lines changed

2 files changed

+81
-6
lines changed

Dockerfile

+76-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,90 @@ FROM node:18.20.4-slim AS base
33
ENV PNPM_HOME="/pnpm"
44
ENV PATH="$PNPM_HOME:$PATH"
55
RUN corepack enable
6-
COPY . /app
6+
7+
#FROM ocaml/opam:ubuntu-22.04-ocaml-4.14@sha256:73f7c5dd28f7b757de325d915562a3f89903a64e763c0e334914fb56e082f5cb as build
8+
RUN apt-get update
9+
RUN apt-get install -y opam
10+
11+
USER root
12+
RUN apt-get update && apt-get install -y --no-install-recommends bubblewrap
13+
RUN opam init --disable-sandboxing --yes
14+
RUN opam exec -- opam update
15+
RUN opam exec -- opam install dune
16+
#RUN opam exec -- opam install --deps-only --with-test -y .
17+
#RUN sudo chown -R opam .
18+
#RUN opam exec -- dune build && opam exec -- dune test
19+
20+
721
WORKDIR /app
822

23+
ADD pnpm-lock.yaml pnpm-lock.yaml
24+
ADD package.json package.json
25+
ADD package-lock.json package-lock.json
26+
ADD tsconfig.examples.json tsconfig.examples.json
27+
ADD tsconfig.json tsconfig.json
28+
ADD tsconfig.mina-signer.json tsconfig.mina-signer.json
29+
ADD tsconfig.mina-signer-web.json tsconfig.mina-signer-web.json
30+
ADD tsconfig.node.json tsconfig.node.json
31+
ADD tsconfig.test.json tsconfig.test.json
32+
ADD tsconfig.web.json tsconfig.web.json
933
FROM base AS prod-deps
1034
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
1135

1236
FROM base AS build
1337
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
1438
#RUN npm run build
39+
RUN opam install -y js_of_ocaml-ppx
40+
RUN apt install -y libjemalloc-dev
41+
42+
## rust
43+
44+
# install toolchain
45+
RUN apt-get install --no-install-recommends -y musl-tools
46+
#RUN curl https://sh.rustup.rs -sSf | bash -x -s -- --default-toolchain stable -y
47+
# Get Rust
48+
RUN apt install -y git curl
49+
50+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --verbose
51+
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
52+
ENV PATH=/root/.cargo/bin:$PATH
53+
# musl tools
54+
55+
# install musl target
56+
#RUN /root/.cargo/bin/rustup target add x86_64-unknown-linux-musl --toolchain stable-x86_64-unknown-linux-gnu
57+
# nightly-2023-09-01-x86_64-unknown-linux-gnu
58+
59+
# make default target to musl
60+
#RUN mkdir /.cargo && \
61+
# echo "[build]\ntarget = \"x86_64-unknown-linux-musl\"" > /.cargo/config
62+
RUN rustup toolchain install nightly-2023-09-01-x86_64-unknown-linux-gnu
63+
RUN rustup component add rust-src --toolchain nightly-2023-09-01-x86_64-unknown-linux-gnu
64+
65+
## now the source copyied
66+
COPY src /app/src
67+
COPY tests /app/tests
68+
COPY benchmark /app/benchmark
69+
COPY jest /app/jest
70+
71+
#RUN rustup toolchain install nightly
72+
73+
74+
COPY dune-project /app/dune-project
75+
# nightly-2023-09-01-x86_64-unknown-linux-gnu
76+
RUN cargo install wasm-pack
77+
RUN opam install -y bin_prot
78+
RUN opam install -y async
79+
RUN opam install -y Core_kernel
80+
RUN opam install -y re2
81+
RUN opam install -y ctypes
82+
RUN opam install -y digestif.ocaml
83+
RUN opam install -y hash_prefix_create.js
84+
RUN opam install -y logger.fake
85+
RUN opam install -y promise.js
86+
RUN opam install -y promise.js_helpers
87+
RUN opam install -y run_in_thread.fake
88+
89+
RUN opam exec -- pnpm run build:bindings
1590
RUN pnpm run build
1691

1792
FROM base
@@ -30,11 +105,6 @@ CMD [ "pnpm", "start" ]
30105
# WORKDIR /app
31106

32107
# # Install required dependencies
33-
# RUN apt update && apt install -y \
34-
# git \
35-
# curl \
36-
# npm \
37-
# nodejs
38108

39109
# # Install Node.js version 18
40110
# RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

README-dev.md

+5
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,8 @@ To facilitate this process, use the provided script named `run-debug`. To use th
222222
This script initializes a Node.js process with the `--inspect-brk` flag that starts the Node.js inspector and breaks before the user script starts (i.e., it pauses execution until a debugger is attached). The `--enable-source-maps` flag ensures that source maps are used to allow easy debugging of o1js code directly.
223223

224224
After the Node.js process is running, open the Chrome browser and navigate to `chrome://inspect` to attach the Chrome Debugger to the Node.js process. You can set breakpoints, inspect variables, and profile the performance of your zkApp or o1js. For more information on using the Chrome Debugger, see the [DevTools documentation](https://developer.chrome.com/docs/devtools/).
225+
226+
227+
# building
228+
229+
`docker build . --progress=plain`

0 commit comments

Comments
 (0)