mirror of
https://github.com/kristoferssolo/tg-relay-rs.git
synced 2026-02-04 06:42:09 +00:00
feat: dockerize
This commit is contained in:
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM rust:1.90-slim-trixie as builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY . .
|
||||
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
pkg-config libssl-dev ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM python:3-slim AS runtime
|
||||
FROM python:3.12-slim-trixie
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
ENV TZ=UTC
|
||||
ENV RUST_LOG=info
|
||||
ENV PATH=/home/app/.local/bin:$PATH
|
||||
|
||||
RUN useradd --create-home --shell /bin/bash app
|
||||
WORKDIR /home/app
|
||||
USER app
|
||||
|
||||
RUN uv tool install instaloader \
|
||||
&& instaloader --version
|
||||
|
||||
COPY --from=builder /app/target/release/tg-relay-rs /usr/local/bin/tg-relay-rs
|
||||
|
||||
CMD ["/usr/local/bin/tg-relay-rs"]
|
||||
Reference in New Issue
Block a user