first commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM rust:1.96-bookworm AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --yes --no-install-recommends \
|
||||
libssl-dev \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY src ./src
|
||||
COPY migrations ./migrations
|
||||
|
||||
RUN cargo build --locked --release --bin backend \
|
||||
&& strip target/release/backend
|
||||
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
|
||||
ARG APP_UID=10001
|
||||
ARG APP_GID=10001
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install --yes --no-install-recommends \
|
||||
ca-certificates \
|
||||
chromium \
|
||||
curl \
|
||||
fonts-liberation \
|
||||
fonts-noto-color-emoji \
|
||||
libssl3 \
|
||||
tini \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& groupadd --gid "${APP_GID}" app \
|
||||
&& useradd --uid "${APP_UID}" --gid "${APP_GID}" --create-home --shell /usr/sbin/nologin app \
|
||||
&& install -d --owner=app --group=app /app /data/media /tmp/leads-extractor-cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /build/target/release/backend /usr/local/bin/leads-extractor
|
||||
COPY --from=builder /build/migrations ./migrations
|
||||
|
||||
ENV SERVER_HOST=0.0.0.0 \
|
||||
SERVER_PORT=8080 \
|
||||
MEDIA_DIR=/data/media \
|
||||
BROWSER_NO_SANDBOX=true \
|
||||
RUST_LOG=backend=info \
|
||||
XDG_CACHE_HOME=/tmp/leads-extractor-cache
|
||||
|
||||
USER app:app
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||
CMD ["/usr/local/bin/leads-extractor"]
|
||||
Reference in New Issue
Block a user