sourize commited on
Commit
9070ad6
Β·
1 Parent(s): dbf975c

Initial Commit

Browse files
Files changed (2) hide show
  1. Dockerfile +29 -0
  2. README.md +16 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies (if needed)
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy requirements and install Python dependencies
13
+ COPY requirements.txt ./
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy the rest of the application
17
+ COPY . .
18
+
19
+ # Expose Streamlit port
20
+ EXPOSE 8501
21
+
22
+ # Streamlit-specific environment variables
23
+ ENV PYTHONUNBUFFERED=1
24
+ ENV STREAMLIT_SERVER_PORT=8501
25
+ ENV STREAMLIT_SERVER_HEADLESS=true
26
+ ENV STREAMLIT_SERVER_ENABLECORS=false
27
+
28
+ # Run the Streamlit app
29
+ ENTRYPOINT ["streamlit", "run", "app.py"]
README.md CHANGED
@@ -35,12 +35,28 @@ customer_loc.pkl
35
  streamlit run app.py
36
  ```
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ## 🌐 Deploy on Hugging Face Spaces
39
  1. Push this repo (with all files, including .pkl models) to a public GitHub repository.
40
  2. Create a new Space on [Hugging Face Spaces](https://huggingface.co/spaces) and select **Streamlit** as the SDK.
41
  3. In "Repository URL", enter your GitHub repo URL.
42
  4. The app will build and deploy automatically!
43
 
 
 
44
  ## πŸ“¦ Requirements
45
  All dependencies are listed in `requirements.txt`.
46
 
 
35
  streamlit run app.py
36
  ```
37
 
38
+ ## 🐳 Docker Deployment
39
+ You can also run this app in a Docker container:
40
+
41
+ 1. Build the Docker image:
42
+ ```bash
43
+ docker build -t fraudlens-app .
44
+ ```
45
+ 2. Run the container:
46
+ ```bash
47
+ docker run -p 8501:8501 fraudlens-app
48
+ ```
49
+
50
+ The app will be available at [http://localhost:8501](http://localhost:8501).
51
+
52
  ## 🌐 Deploy on Hugging Face Spaces
53
  1. Push this repo (with all files, including .pkl models) to a public GitHub repository.
54
  2. Create a new Space on [Hugging Face Spaces](https://huggingface.co/spaces) and select **Streamlit** as the SDK.
55
  3. In "Repository URL", enter your GitHub repo URL.
56
  4. The app will build and deploy automatically!
57
 
58
+ > **Note:** For Docker-based Spaces, select the **Docker** SDK and ensure your Dockerfile is present in the repo.
59
+
60
  ## πŸ“¦ Requirements
61
  All dependencies are listed in `requirements.txt`.
62