2024-07-11 02:47:14 +05:30
|
|
|
#FROM node:16.9.1 as frontend
|
|
|
|
#COPY package.json package-lock.json /src/
|
|
|
|
#WORKDIR /src
|
|
|
|
#RUN npm install
|
|
|
|
#COPY . .
|
|
|
|
#RUN npm run sass
|
|
|
|
#
|
2024-07-11 02:54:39 +05:30
|
|
|
FROM rustlang/rust:nightly-slim as rust
|
2024-07-11 02:47:14 +05:30
|
|
|
WORKDIR /src
|
|
|
|
RUN apt-get update && apt-get install -y git pkg-config libssl-dev make
|
|
|
|
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
|
|
|
COPY Cargo.toml .
|
|
|
|
RUN sed -i '/.*build.rs.*/d' Cargo.toml
|
|
|
|
COPY Cargo.lock .
|
|
|
|
RUN cargo build --release || true
|
|
|
|
#COPY --from=frontend /src/static/ /src/static/
|
|
|
|
COPY . /src
|
|
|
|
#RUN cd utils/cache-bust && cargo run
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
FROM debian:latest
|
|
|
|
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
|
|
|
|
RUN useradd -ms /bin/bash forgeflux
|
|
|
|
#RUN mkdir -p /var/www/forgeflux && chown forgeflux /var/www/forgeflux
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates
|
|
|
|
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
COPY --from=rust /src/target/release/forgeflux /usr/local/bin/
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|