Update Dockerfile
Some checks failed
Build Docker Image on Commit / build-and-publish (push) Failing after 1m0s

This commit is contained in:
merith-tk 2025-04-21 18:02:55 +01:00
parent c0e803f683
commit 9113b58c6a

View file

@ -1 +1,53 @@
FROM alpine:3.12
# Stage 1: Builder
FROM node:18-bullseye-slim as builder
RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get upgrade -yqq \
&& apt-get install --no-install-recommends -y \
build-essential \
curl \
ca-certificates \
llvm-13 \
llvm-13-dev \
libclang-common-13-dev \
zlib1g-dev \
git \
&& apt-get clean \
&& rm -fr /var/lib/apt/lists/*
ENV PATH="/usr/lib/llvm-13/bin/:${PATH}"
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup target add wasm32-unknown-unknown
# NodeJS/NPM Dependencies
RUN npx --package typescript tsc --init
RUN npm install --global webpack
RUN npm install --global webpack-cli
RUN npm install @msgpack/msgpack
RUN npm install bs58
# Clone and build freenet-core
WORKDIR /src
RUN git clone https://github.com/freenet/freenet-core.git freenet
WORKDIR /src/freenet/crates/core
RUN cargo install --path .
# Stage 2: Runner
FROM debian:bullseye-slim
RUN DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get upgrade -yqq \
&& apt-get install --no-install-recommends -y \
ca-certificates \
&& apt-get clean \
&& rm -fr /var/lib/apt/lists/*
# Copy the built binary from the builder stage
COPY --from=builder /root/.cargo/bin/freenet /usr/local/bin/freenet
CMD ["freenet", "-b", "0.0.0.0"]