-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile.dev
More file actions
84 lines (65 loc) · 2.02 KB
/
Dockerfile.dev
File metadata and controls
84 lines (65 loc) · 2.02 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
RUST_LOG=warn \
PATH="/root/.cargo/bin:${PATH}" \
NVIDIA_DRIVER_CAPABILITIES=all \
CUDA_HOME=/usr/local/cuda
# Install dependencies including compilation tools
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
nginx \
build-essential \
gcc-11 \
g++-11 \
pkg-config \
libssl-dev \
netcat-openbsd \
lsof \
gzip \
expect \
&& rm -rf /var/lib/apt/lists/*
# Create Nginx log directory
RUN mkdir -p /var/log/nginx
# Set gcc-11 as default compiler (needed for CUDA compilation)
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
WORKDIR /app
# Create necessary directories
RUN mkdir -p /app/data/markdown \
/app/data/metadata \
/app/data/runtime \
/app/user_settings \
/app/client
# Copy Rust files first
COPY Cargo.toml Cargo.lock ./
COPY src ./src
# Copy client directory with all frontend files
COPY client ./client
# Install Node.js dependencies
WORKDIR /app/client
RUN npm install
WORKDIR /app
# Copy Nginx config
COPY nginx.dev.conf /etc/nginx/nginx.conf
# Update dependencies
RUN cargo update
# Build Rust with GPU features
RUN cargo build --features gpu && \
cp target/debug/webxr /app/webxr
# PTX compilation - now happens during container build
COPY scripts/compile_ptx.sh ./scripts/
COPY src/utils/compute_forces.cu ./src/utils/
RUN chmod +x ./scripts/compile_ptx.sh && \
# Get CUDA_ARCH from build arg or default to 86
CUDA_ARCH=${CUDA_ARCH:-86} ./scripts/compile_ptx.sh
# Development entrypoint script
COPY scripts/dev-entrypoint.sh ./
RUN chmod +x ./dev-entrypoint.sh
EXPOSE 3001 4000 5173 24678
ENTRYPOINT ["./dev-entrypoint.sh"]