forked from tari-project/ootle.ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (44 loc) · 1.54 KB
/
Dockerfile
File metadata and controls
52 lines (44 loc) · 1.54 KB
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
# Use Node.js 22.13.1 as the base image
FROM node:22.13.1-slim
# Set working directory
WORKDIR /app
# Add proto to PATH and set environment
ENV PATH="/root/.proto/bin:${PATH}"
ENV PROTO_HOME="/root/.proto"
ENV SHELL="/bin/bash"
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
python3 \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g pnpm@latest \
&& curl -fsSL https://moonrepo.dev/install/proto.sh | bash -s -- -y \
&& /bin/bash -c "source ~/.bashrc && source ~/.profile"
# Clone tari-ootle repo at the same level (required for building)
WORKDIR /
RUN git clone https://github.com/tari-project/tari-ootle.git
# Set up project
WORKDIR /app
COPY . .
# Use proto to set up the environment (with explicit shell sourcing)
SHELL ["/bin/bash", "-c"]
RUN proto use \
&& pnpm install \
&& moon tarijs:build
# Create combined dist directory and copy all dist folders while excluding node_modules
RUN mkdir -p /app/combined_dist && \
for pkg in /app/packages/*/; do \
if [ -d "${pkg}dist" ]; then \
pkg_name=$(basename $pkg); \
mkdir -p "/app/combined_dist/${pkg_name}/dist"; \
cp -r "${pkg}dist/"* "/app/combined_dist/${pkg_name}/dist/"; \
cp "${pkg}package.json" "/app/combined_dist/${pkg_name}/package.json"; \
fi \
done && \
find /app/packages -name "node_modules" -type d -exec rm -rf {} +
# Set working directory to the combined dist
WORKDIR /app/combined_dist
# Set default command
CMD ["bash"]