File size: 1,210 Bytes
f481cbe
 
 
18b87a8
 
 
3eea93e
18b87a8
89b4019
18b87a8
 
 
cae1910
18b87a8
 
 
f481cbe
cae1910
18b87a8
 
 
cae1910
f481cbe
89b4019
cae1910
 
 
4021018
609bf51
5bf9a87
4021018
cae1910
 
ed0cba3
89b4019
 
094c28c
5bf9a87
 
f481cbe
89b4019
5bf9a87
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
# Use an official Python runtime as a parent image
FROM python:3.11.1

# Set up user
RUN useradd -m -u 1000 user
USER user

# Install Cargo (Rust's package manager), needed for hf_transfer
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

# Set up environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:/home/user/.cargo/bin:$PATH

# Set the working directory in the container
WORKDIR $HOME/app

# Copy the current directory contents into the container at /home/user/app
COPY --chown=user . $HOME/app

# Set user to root
USER root

# Install any needed packages specified in requirements.txt
RUN python -m venv /venv && \
    /venv/bin/pip install --no-cache-dir -r requirements.txt

# Fix broken OpenCV installation for docker container
RUN apt-get update && apt-get install -y libgl1 && apt-get install -y python3-opencv 
# RUN /venv/bin/pip install opencv-python

# Set user back to non-root
USER user

# Make port 80 available to the world outside this container
EXPOSE 80

# Generate requirements.txt using pip freeze
RUN /venv/bin/pip freeze > requirements.txt

# Run train_llm.py when the container launches
CMD ["/bin/bash", "-c", "source /venv/bin/activate && python train_llm.py"]