Felladrin commited on
Commit
9f538bd
·
1 Parent(s): 5a05fd1

Containerize app with Python 3.12 and add Docker configuration

Browse files
Files changed (2) hide show
  1. Dockerfile +22 -0
  2. README.md +2 -3
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ PORT=8501
6
+
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ git git-lfs ffmpeg libsm6 libxext6 cmake libgl1 build-essential \
9
+ && rm -rf /var/lib/apt/lists/* \
10
+ && git lfs install
11
+
12
+ WORKDIR /app
13
+
14
+ COPY requirements.txt ./
15
+ RUN pip install --no-cache-dir -U pip \
16
+ && pip install --no-cache-dir -r requirements.txt
17
+
18
+ COPY . .
19
+
20
+ EXPOSE 8501
21
+
22
+ CMD ["sh", "-c", "streamlit run app.py --server.port $PORT --server.address 0.0.0.0"]
README.md CHANGED
@@ -3,9 +3,8 @@ title: Convert to ONNX
3
  emoji: ☯
4
  colorFrom: indigo
5
  colorTo: yellow
6
- sdk: streamlit
7
- sdk_version: 1.50.0
8
- app_file: app.py
9
  pinned: true
10
  license: apache-2.0
11
  short_description: Convert a Hugging Face model to ONNX format
 
3
  emoji: ☯
4
  colorFrom: indigo
5
  colorTo: yellow
6
+ sdk: docker
7
+ app_port: 8501
 
8
  pinned: true
9
  license: apache-2.0
10
  short_description: Convert a Hugging Face model to ONNX format