mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
use chef
This commit is contained in:
parent
a51433d7e7
commit
ce23790d9e
29
Dockerfile
29
Dockerfile
@ -1,5 +1,5 @@
|
|||||||
# Create our development image
|
# Create our development image
|
||||||
FROM rust:1.62-slim-bullseye AS builder
|
FROM rust:1.62-slim-bullseye AS builder-base
|
||||||
|
|
||||||
# Set env for our builder
|
# Set env for our builder
|
||||||
ENV CARGO_TERM_COLOR=always
|
ENV CARGO_TERM_COLOR=always
|
||||||
@ -19,10 +19,6 @@ RUN apt update && \
|
|||||||
npm install -g npm && \
|
npm install -g npm && \
|
||||||
npm install -g yarn && \
|
npm install -g yarn && \
|
||||||
npm install -g pnpm
|
npm install -g pnpm
|
||||||
|
|
||||||
# Install wasm-pack and rollup
|
|
||||||
RUN npm install -g wasm-pack && \
|
|
||||||
npm install -g rollup
|
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
### Only enable if building non-native architecture ###
|
### Only enable if building non-native architecture ###
|
||||||
@ -49,12 +45,32 @@ RUN npm install -g wasm-pack && \
|
|||||||
### add armhf target
|
### add armhf target
|
||||||
#RUN rustup target add rustup target add armv7-unknown-linux-gnueabihf
|
#RUN rustup target add rustup target add armv7-unknown-linux-gnueabihf
|
||||||
|
|
||||||
|
|
||||||
|
# Install cargo-chef and wasm-pack via cargo [npm dont have arm64 bin]
|
||||||
|
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo install cargo-chef wasm-pack
|
||||||
|
RUN rustup target add wasm32-unknown-unknown
|
||||||
|
# Install rollup
|
||||||
|
RUN npm install -g rollup
|
||||||
|
|
||||||
|
|
||||||
|
# Prepare dependencies
|
||||||
|
FROM builder-base AS planner
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN cargo chef prepare --recipe-path /tmp/recipe.json
|
||||||
|
|
||||||
|
# Build depedencies
|
||||||
|
FROM builder-base AS builder
|
||||||
|
COPY --from=planner /tmp/recipe.json recipe.json
|
||||||
|
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo chef cook --release -p lldap_app --target wasm32-unknown-unknown
|
||||||
|
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo chef cook --release -p lldap
|
||||||
|
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo chef cook --release -p migration-tool
|
||||||
COPY . /lldap-src
|
COPY . /lldap-src
|
||||||
WORKDIR /lldap-src
|
WORKDIR /lldap-src
|
||||||
|
|
||||||
# Compiling application, take your time
|
# Compiling application, take your time
|
||||||
### amd64
|
### amd64
|
||||||
RUN cargo build --target=x86_64-unknown-linux-gnu --release -p lldap -p migration-tool
|
RUN cargo build --target=x86_64-unknown-linux-gnu --release -p lldap -p migration-tool
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
### Only enable if building non-native architecture ###
|
### Only enable if building non-native architecture ###
|
||||||
#######################################################
|
#######################################################
|
||||||
@ -63,6 +79,7 @@ RUN cargo build --target=x86_64-unknown-linux-gnu --release -p lldap -p migratio
|
|||||||
### armhf
|
### armhf
|
||||||
#RUN cargo build --target=armv7-unknown-linux-gnueabihf --release -p lldap -p migration-tool
|
#RUN cargo build --target=armv7-unknown-linux-gnueabihf --release -p lldap -p migration-tool
|
||||||
|
|
||||||
|
|
||||||
### Build frontend
|
### Build frontend
|
||||||
RUN app/build.sh
|
RUN app/build.sh
|
||||||
# Prepare our application path
|
# Prepare our application path
|
||||||
|
Loading…
Reference in New Issue
Block a user