orario-scolastico-itet/Dockerfile

35 lines
697 B
Docker
Raw Normal View History

FROM rust:1.80 AS builder
WORKDIR /code
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release
COPY src src
COPY templates templates
RUN cargo install --path .
FROM debian:bookworm-slim AS runtime
RUN apt-get update && \
apt-get install -y libssl-dev curl python3 python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /usr/local/cargo/bin/orario-scolastico-itet .
RUN python3 -m venv pyenv && \
bash -c "source pyenv/bin/activate"
RUN ./pyenv/bin/pip install pdfplumber
ENV PATH $PATH:/app/pyenv/bin
COPY static static
COPY pdf2csv.py .
EXPOSE 3000
CMD ["./orario-scolastico-itet"]