librepages/Dockerfile

30 lines
931 B
Text
Raw Normal View History

FROM node:20.15.0 as frontend
COPY package.json package-lock.json /src/
WORKDIR /src
RUN npm install
COPY . .
RUN npm run sass
2022-03-15 15:29:21 +05:30
FROM rust:slim as rust
2021-10-29 20:38:56 +05:30
WORKDIR /src
RUN apt-get update && apt-get install -y git pkg-config libssl-dev make
2021-10-29 20:38:56 +05:30
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/
2021-10-29 20:38:56 +05:30
COPY . /src
RUN cd utils/cache-bust && cargo run
2021-10-29 20:38:56 +05:30
RUN cargo build --release
FROM debian:bullseye-slim
2022-12-19 06:32:51 +05:30
#RUN useradd -ms /bin/bash -u 1000 librepages
#RUN mkdir -p /var/www/librepages && chown librepages /var/www/librepages
2021-10-29 20:38:56 +05:30
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
2022-12-19 06:32:51 +05:30
COPY --from=rust /src/target/release/librepages /usr/local/bin/
2021-10-29 20:38:56 +05:30
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]