matsuap commited on
Commit
0bdd781
·
verified ·
1 Parent(s): 5212bfa

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -8
Dockerfile CHANGED
@@ -1,15 +1,22 @@
1
  FROM python:3.11-slim
2
 
3
  # Install system dependencies
4
- # ffmpeg for audio/video processing
5
- # poppler-utils for pdf2image
6
- # default-libmysqlclient-dev or unixodbc-dev if needed for DB
7
  RUN apt-get update && apt-get install -y \
8
  ffmpeg \
9
  poppler-utils \
10
  libvips-dev \
11
  curl \
12
  git \
 
 
 
 
 
 
 
 
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
  # Set the working directory
@@ -21,7 +28,7 @@ COPY requirements.txt .
21
  # Install dependencies
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # Create a non-root user (Hugging Face requirement for security)
25
  RUN useradd -m -u 1000 user
26
  USER user
27
  ENV HOME=/home/user \
@@ -29,14 +36,12 @@ ENV HOME=/home/user \
29
 
30
  WORKDIR $HOME/app
31
 
32
- # Copy the rest of the application code
33
  COPY --chown=user . $HOME/app
34
 
35
- # Fix permissions for any local storage if needed
36
  RUN mkdir -p $HOME/app/assets && chmod 777 $HOME/app/assets
37
 
38
- # Use port 7860 as it's the default for Hugging Face Spaces
39
  EXPOSE 7860
40
 
41
- # Command to run the application
42
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.11-slim
2
 
3
  # Install system dependencies
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  ffmpeg \
6
  poppler-utils \
7
  libvips-dev \
8
  curl \
9
  git \
10
+ unixodbc \
11
+ unixodbc-dev \
12
+ gnupg2 \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Install Microsoft ODBC Driver for SQL Server (required for pyodbc on Linux)
16
+ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
17
+ && curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \
18
+ && apt-get update \
19
+ && ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
  # Set the working directory
 
28
  # Install dependencies
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
31
+ # Create a non-root user
32
  RUN useradd -m -u 1000 user
33
  USER user
34
  ENV HOME=/home/user \
 
36
 
37
  WORKDIR $HOME/app
38
 
39
+ # Copy the application code
40
  COPY --chown=user . $HOME/app
41
 
42
+ # Fix permissions
43
  RUN mkdir -p $HOME/app/assets && chmod 777 $HOME/app/assets
44
 
 
45
  EXPOSE 7860
46
 
 
47
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]