FROM python:3.11-alpine AS base # install rust environment (for rant) ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUST_VERSION=1.61.0 RUN apk add --no-cache rustup gcc musl-dev RUN rustup-init -y --profile minimal # install rant RUN cargo install --color=never rant --version 4.0.0-alpha.33 --root / --features cli # python prereqs COPY app/requirements.txt /app/requirements.txt RUN pip install -r /app/requirements.txt # cleanup RUN cargo install cargo-cache --root / RUN cargo cache --remove-dir all RUN pip cache purge RUN apk del rustup gcc musl-dev FROM base AS app RUN mkdir -p /lib/wordlist COPY ext/imsky/wordlists /lib/wordlist RUN mkdir -p /app/rant RUN python /lib/wordlist/render.py -o rant /app/rant/wordlist.rant # installing app COPY app /app WORKDIR /app CMD [ "python", "index.wsgi" ] EXPOSE 80 FROM app AS dev COPY static /app/static