Corran commited on
Commit
5a78dc3
·
verified ·
1 Parent(s): dc66529

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -37
Dockerfile CHANGED
@@ -1,44 +1,19 @@
1
- # Base image with CUDA and development tools
2
- FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu22.04
3
-
4
- # Environment settings
5
- ARG DEBIAN_FRONTEND=noninteractive
6
- ENV PYTHONUNBUFFERED=1
7
-
8
- # Install required dependencies
9
- RUN apt-get update && apt-get install --no-install-recommends -y \
10
- build-essential \
11
- python3.9 \
12
- python3-pip \
13
- git \
14
- wget \
15
- && apt-get clean && rm -rf /var/lib/apt/lists/*
16
-
17
- # Set up the working directory
18
- WORKDIR /code
19
-
20
- # Copy requirements and install dependencies
21
- COPY ./requirements.txt /code/requirements.txt
22
- RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
23
-
24
- # Set up a new non-root user
25
  RUN useradd -m -u 1000 user
26
  USER user
27
 
28
- # Set environment variables for the user
29
- ENV HOME=/home/user \
30
- PATH=/home/user/.local/bin:$PATH \
31
- PYTHONPATH=$HOME/app \
32
- PYTHONUNBUFFERED=1 \
33
- SYSTEM=spaces
34
 
35
- # Set the working directory for the application
36
- WORKDIR $HOME/app
37
 
38
- # Copy files and set ownership
39
- COPY --chown=user . $HOME/app
40
 
41
- RUN python3 -m spacy download en_core_web_sm
42
 
43
- # Enable auto-reload using polling to ensure changes are detected
44
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
1
+ # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.9
5
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  RUN useradd -m -u 1000 user
7
  USER user
8
 
9
+ ENV PATH="/home/user/.local/bin:$PATH"
10
+
11
+ COPY . .
 
 
 
12
 
13
+ WORKDIR /
 
14
 
15
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
16
 
17
+ RUN python -m spacy download en_core_web_sm
18
 
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]