File size: 832 Bytes
7c49463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04 AS dev

RUN apt-get update -y \
    && apt-get install -y python3-pip git

WORKDIR /workspace

# install build and runtime dependencies
COPY requirements.txt requirements.txt
COPY aiproxy aiproxy

RUN --mount=type=cache,target=/root/.cache/pip \
    pip install -r requirements.txt

# Create a non-root user
RUN useradd -m appuser

# Transfer ownership of the /workspace to the new non-root user
RUN chown -R appuser:appuser /workspace

# Create a cache directory within the appuser's home directory and transfer ownership
RUN mkdir -p /home/appuser/cache && \
    chown -R appuser:appuser /home/appuser/cache

# Switch to the non-root user for subsequent commands and container runtime
USER appuser

CMD ["python3", "-m", \
    "aiproxy", \
    "--host", "0.0.0.0", \
    "--port", "7860"]