Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
62 lines (51 loc) · 1.85 KB
/
Copy pathDockerfile.dev
File metadata and controls
62 lines (51 loc) · 1.85 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
# syntax=docker/dockerfile:1.7
# ==============================================================================
# ObsetyNC — development container.
#
# Use this image for interactive work: cargo watch, npm run dev, running tests,
# iterating on code. Source is mounted as a volume at runtime — the image itself
# only carries the toolchain.
#
# Build:
# docker build -f Dockerfile.dev -t obsetync/dev:local .
#
# Run an interactive shell with the project mounted:
# docker run --rm -it -v "$PWD":/build obsetync/dev:local bash
#
# Or use `just dev` which wraps this.
# ==============================================================================
FROM rust:1.95-bookworm
ARG TARGETARCH
ENV CARGO_TERM_COLOR=always \
CARGO_NET_RETRY=5 \
RUSTFLAGS="--remap-path-prefix=/build=." \
DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
clang \
cmake \
perl \
git \
ca-certificates \
curl \
build-essential \
pkg-config \
less \
vim-tiny \
&& rm -rf /var/lib/apt/lists/*
# Node.js 20 for the plugin build.
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y --no-install-recommends nodejs && \
rm -rf /var/lib/apt/lists/*
# Rust extras: wasm target, common dev tools.
RUN rustup target add wasm32-unknown-unknown && \
rustup component add rustfmt clippy rust-src
COPY scripts/install-wasm-tools.sh /tmp/install-wasm-tools.sh
RUN bash /tmp/install-wasm-tools.sh "${TARGETARCH}" && rm /tmp/install-wasm-tools.sh
# Dev commands — bookworm does not provide a just package.
RUN --mount=type=cache,id=dev-cargo-registry,target=/usr/local/cargo/registry \
cargo install --locked just cargo-watch
WORKDIR /build
# Ports: 27182 sync API, 27183 admin UI.
EXPOSE 27182 27183
CMD ["bash"]