File size: 965 Bytes
709c473 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
FROM python:3.10
# Set environment to non-interactive (avoids tzdata prompts)
ENV DEBIAN_FRONTEND=noninteractive
# Update packages and install dependencies for Rust
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
build-essential \
pkg-config \
libffi-dev \
libssl-dev \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Rust (via official rustup script)
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
# Add Rust to PATH
ENV PATH="/root/.cargo/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy your files
COPY . /app
ENV TMPDIR=/app/tmp
RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
RUN chmod -R 777 /app
# Confirm versions
RUN rustc --version && cargo --version
# Optional: install Python deps
RUN python3 -m pip install -r requirements.txt
EXPOSE 7860
CMD [ "python", "app.py" ]
|