feat(docker): add docker and compose support
This commit is contained in:
parent
41e5fd5f13
commit
2df5352c1c
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
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"]
|
6
docker-compose.yaml
Normal file
6
docker-compose.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
Loading…
Reference in New Issue
Block a user