Add Dockerfile
This commit is contained in:
parent
7ebcdf28d2
commit
704372d29a
34
Dockerfile
Normal file
34
Dockerfile
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Build
|
||||||
|
FROM rust:1.75-slim AS builder
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
cmake \
|
||||||
|
nasm \
|
||||||
|
clang \
|
||||||
|
pkg-config \
|
||||||
|
libssl-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Compile for prod
|
||||||
|
RUN cargo build --release --bin scrape
|
||||||
|
|
||||||
|
# Lightweight image
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
# Runtime libs
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
ca-certificates \
|
||||||
|
libssl3 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy binary to bin folder
|
||||||
|
COPY --from=builder /app/target/release/scrape /usr/local/bin/scrape
|
||||||
|
|
||||||
|
# Run scraping
|
||||||
|
CMD ["scrape"]
|
||||||
Loading…
Reference in a new issue