Spaces:
Paused
Paused
File size: 1,522 Bytes
a657fe5 14036b7 cc9baa0 14036b7 a657fe5 dcee161 f5ff541 a657fe5 f5ff541 a657fe5 dcee161 a657fe5 dcee161 a657fe5 cc9baa0 a657fe5 cc9baa0 a657fe5 cc9baa0 14036b7 cc9baa0 a657fe5 cc9baa0 |
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# Use Python base image
FROM python:3.9
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
SHELL=/bin/bash \
TZ=Europe/Paris
# Install some basic utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
curl \
git \
sudo \
procps \
git-lfs \
zip \
unzip \
htop \
vim \
nano \
bzip2 \
build-essential \
libsndfile-dev \
&& rm -rf /var/lib/apt/lists/*
# Create the /app and /data directories and set permissions before switching to the non-root user
RUN mkdir -p /app /data && \
chmod -R 777 /data && \
adduser --disabled-password --gecos '' --shell /bin/bash user && \
chown -R user:user /app
# Allow the user to run sudo commands without a password
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
# Switch to the non-root user
USER user
# Set the user's home directory and configure permissions for home directories
ENV HOME=/home/user
RUN mkdir -p $HOME/.cache $HOME/.config && chmod -R 777 $HOME
# Set the working directory to /app
WORKDIR /app
# Copy requirements.txt and install dependencies as the non-root user
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the start_server.sh script and make it executable
COPY --chown=user start_server.sh .
RUN chmod +x start_server.sh
# Expose the MLflow port
EXPOSE 7860
# Start the MLflow server using the start_server.sh script
CMD ["./start_server.sh"]
|