-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.Dockerfile
More file actions
41 lines (31 loc) · 1.26 KB
/
Copy pathdev.Dockerfile
File metadata and controls
41 lines (31 loc) · 1.26 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
ARG RUST_VERSION=1
ARG DEBIAN_VERSION=bookworm
FROM rust:${RUST_VERSION}-slim-${DEBIAN_VERSION}
# Install system dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
libsqlite3-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js and pnpm
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& corepack enable
# Install Rust development tools
# watchexec-cli official builds have an incompatible glibc, so we don't use them.
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git/db \
curl --retry 5 -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \
&& cargo binstall --no-confirm watchexec-cli --disable-strategies crate-meta-data \
&& cargo binstall --no-confirm sccache
WORKDIR /app
# Copy package files and install Node dependencies
COPY package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
pnpm install
# Copy source code
COPY . .
EXPOSE 3000
# Run both commands in parallel
CMD ["sh", "-c", "pnpm run watch & watchexec -r -e rs,j2,toml cargo run -- -vv"]