-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.local
45 lines (41 loc) · 1.5 KB
/
Dockerfile.local
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
FROM rust:1.82.0 as builder
WORKDIR /tmp/sdre-hub
# hadolint ignore=DL3008,DL3003,SC1091,DL4006
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends libzmq3-dev && \
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && \
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && \
cargo binstall trunk wasm-bindgen-cli --no-confirm && \
rustup target add wasm32-unknown-unknown
COPY . .
# hadolint ignore=DL3008,DL3003,SC1091
RUN set -x && \
cargo build --release --bin sdre-hub && \
cd sh-frontend && \
trunk build --release
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY rootfs /
COPY --from=builder /tmp/sdre-hub/target/release/sdre-hub /opt/sdre-hub
COPY --from=builder /tmp/sdre-hub/sh-frontend/dist /opt/sh-frontend
ENV SH_DATA_PATH="/opt/sdre-hub-data"
# hadolint ignore=DL3008,DL3003,SC1091
RUN set -x && \
KEPT_PACKAGES=() && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES+=(libzmq5) && \
KEPT_PACKAGES+=(nginx-light) && \
apt-get update && \
apt-get install -y --no-install-recommends \
"${KEPT_PACKAGES[@]}" \
"${TEMP_PACKAGES[@]}"\
&& \
# ensure binaries are executable
chmod -v a+x \
/opt/sdre-hub \
&& \
# clean up
apt-get remove -y "${TEMP_PACKAGES[@]}" && \
apt-get autoremove -y && \
rm -rf /src/* /tmp/* /var/lib/apt/lists/*