genomenet commited on
Commit
84deb4c
·
1 Parent(s): 52e5b45

Use custom Dockerfile for TensorFlow 2.15 compatibility

Browse files
Files changed (3) hide show
  1. Dockerfile +35 -0
  2. README.md +1 -3
  3. app.py +1 -1
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Set environment variables
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV TF_CPP_MIN_LOG_LEVEL=2
7
+
8
+ # Install system dependencies
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Create user for HuggingFace Spaces
14
+ RUN useradd -m -u 1000 user
15
+ USER user
16
+ ENV HOME=/home/user
17
+ ENV PATH=/home/user/.local/bin:$PATH
18
+
19
+ WORKDIR /home/user/app
20
+
21
+ # Copy requirements first for better caching
22
+ COPY --chown=user:user requirements.txt .
23
+
24
+ # Install Python dependencies
25
+ RUN pip install --no-cache-dir --upgrade pip && \
26
+ pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Copy application code
29
+ COPY --chown=user:user . .
30
+
31
+ # Expose port
32
+ EXPOSE 7860
33
+
34
+ # Run the application
35
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,9 +3,7 @@ title: CRISPR Array Detection
3
  emoji: 🧬
4
  colorFrom: blue
5
  colorTo: green
6
- sdk: gradio
7
- sdk_version: 4.44.0
8
- app_file: app.py
9
  pinned: false
10
  license: mit
11
  ---
 
3
  emoji: 🧬
4
  colorFrom: blue
5
  colorTo: green
6
+ sdk: docker
 
 
7
  pinned: false
8
  license: mit
9
  ---
app.py CHANGED
@@ -259,4 +259,4 @@ if __name__ == "__main__":
259
  model = get_model()
260
  warmup_model(model)
261
  print(f"Model ready! GPU: {get_gpu_status()}")
262
- demo.launch()
 
259
  model = get_model()
260
  warmup_model(model)
261
  print(f"Model ready! GPU: {get_gpu_status()}")
262
+ demo.launch(server_name="0.0.0.0", server_port=7860)