imseldrith commited on
Commit
40ce1fb
1 Parent(s): 2a8b06e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -10
Dockerfile CHANGED
@@ -7,24 +7,22 @@ RUN apt-get update && apt-get install --no-install-recommends -y curl ffmpeg
7
  RUN if [ "$TARGETPLATFORM" != "linux/amd64" ]; then apt-get install --no-install-recommends -y build-essential ; fi
8
  RUN if [ "$TARGETPLATFORM" != "linux/amd64" ]; then curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ; fi
9
  ENV PATH="/root/.cargo/bin:${PATH}"
10
- # for deepspeed support - doesn't seem worth it, image +7.5GB, over the 10GB ghcr.io limit, and no noticable gain in speed or VRAM usage?
11
- #RUN curl -O https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.1-1_all.deb
12
- #RUN dpkg -i cuda-keyring_1.1-1_all.deb && rm cuda-keyring_1.1-1_all.deb
13
- #RUN apt-get update && apt-get install --no-install-recommends -y libaio-dev build-essential cuda-toolkit
14
- #ENV CUDA_HOME=/usr/local/cuda
15
  RUN apt-get clean && rm -rf /var/lib/apt/lists/*
16
 
17
- WORKDIR /app
 
 
 
18
  RUN mkdir -p voices config
19
 
20
  ARG USE_ROCM
21
  ENV USE_ROCM=${USE_ROCM}
22
 
23
- COPY requirements*.txt /app/
24
- RUN if [ "${USE_ROCM}" = "1" ]; then mv /app/requirements-rocm.txt /app/requirements.txt; fi
25
- RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt
26
 
27
- COPY *.py *.sh *.default.yaml README.md LICENSE /app/
28
 
29
  ARG PRELOAD_MODEL
30
  ENV PRELOAD_MODEL=${PRELOAD_MODEL}
 
7
  RUN if [ "$TARGETPLATFORM" != "linux/amd64" ]; then apt-get install --no-install-recommends -y build-essential ; fi
8
  RUN if [ "$TARGETPLATFORM" != "linux/amd64" ]; then curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ; fi
9
  ENV PATH="/root/.cargo/bin:${PATH}"
10
+
 
 
 
 
11
  RUN apt-get clean && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Add a non-root user and set permissions
14
+ RUN useradd -ms /bin/bash appuser
15
+ USER appuser
16
+ WORKDIR /home/appuser/app
17
  RUN mkdir -p voices config
18
 
19
  ARG USE_ROCM
20
  ENV USE_ROCM=${USE_ROCM}
21
 
22
+ COPY requirements*.txt /home/appuser/app/
23
+ RUN --mount=type=cache,target=/home/appuser/.cache/pip pip install -r requirements.txt
 
24
 
25
+ COPY *.py *.sh *.default.yaml README.md LICENSE /home/appuser/app/
26
 
27
  ARG PRELOAD_MODEL
28
  ENV PRELOAD_MODEL=${PRELOAD_MODEL}