Spaces:
Running
Running
File size: 1,582 Bytes
35b2345 807092d 35b2345 1e0b4e7 35b2345 1e0b4e7 dc444bb 1e0b4e7 aa4981d cbcc785 1e0b4e7 fd7db7b cbcc785 e2d06a9 cbcc785 e2d06a9 303ce0f d5b9dc7 1e0b4e7 d5b9dc7 94d9c1e 5d539a8 303ce0f 5d539a8 303ce0f |
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 61 62 63 64 65 66 67 |
#################### Layer 1
# Using the ollama docker image as a base, so we get nvidia support for free,
# install python3 with venv and pip.
#
FROM ollama/ollama:latest as just-add-python
RUN apt update && \
apt install -qy \
git curl wget \
python3 python-is-python3 python3-venv python3-pip \
&& \
# Shrink the layer's footprint \
apt autoclean && \
rm -rf /var/lib/apt/lists/*
COPY ./script.sh /tmp/script.sh
WORKDIR /tmp
RUN chmod +x script.sh \
&& ./script.sh
EXPOSE 11434
# Set the working directory
WORKDIR /app
# Copy requirements file
COPY requirements.txt requirements.txt
# Create a virtual environment
RUN python -m venv venv
# Set the PATH to use the virtual environment
ENV PATH="/app/venv/bin:$PATH"
# Update package list and install necessary packages in a single step
RUN apt-get update && apt-get install -y \
curl \
build-essential \
libffi-dev \
cmake \
libcurl4-openssl-dev \
tini \
systemd && \
apt-get clean
# Upgrade pip and install dependencies
RUN python -m pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh
RUN which ollama
# Expose the port the application uses (replace 11434 with the actual port)
EXPOSE 11434
# Copy the entire application
COPY . .
# Set proper permissions for the translations directory
RUN chmod -R 777 translations
# Copy the init script
COPY init.sh /app/init.sh
RUN chmod +x /app/init.sh
# Define the command to run the init script
CMD ["/bin/bash", "/app/init.sh"]
|