ashishbangwal commited on
Commit
2108804
·
1 Parent(s): d46bc4c

change docker2

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -17
Dockerfile CHANGED
@@ -1,32 +1,27 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Create app directory
5
- WORKDIR /home/appuser/app
6
-
7
- # Set environment variables
8
- ENV PATH="/home/appuser/.local/bin:$PATH"
9
  ENV PYTHONDONTWRITEBYTECODE=1
10
  ENV PYTHONUNBUFFERED=1
11
 
12
- # Install dependencies
13
- COPY requirement.txt .
14
- RUN pip install --upgrade pip \
15
- && pip install --user -r requirement.txt
16
 
17
- # Add a non-root user
18
- RUN adduser --disabled-password --gecos "" appuser
19
- USER appuser
20
 
21
- # Copy code
22
- COPY --chown=appuser:appuser . .
 
23
 
24
- # Expose ports
25
  EXPOSE 8000
26
  EXPOSE 8501
27
 
28
- # Start FastAPI then Streamlit
29
  CMD uvicorn streamlit_app.main_api:app --host 0.0.0.0 --port 8000 & \
30
  streamlit run streamlit_app/app.py --server.port 8501
31
 
32
 
 
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Add ~/.local/bin to PATH for script access
4
+ ENV PATH="/root/.local/bin:$PATH"
 
 
 
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
 
8
+ # Set working directory
9
+ WORKDIR /app
 
 
10
 
11
+ # Copy files
12
+ COPY . .
 
13
 
14
+ # Install Python dependencies
15
+ RUN pip install --user --upgrade pip \
16
+ && pip install --user -r requirement.txt
17
 
18
+ # Expose FastAPI and Streamlit ports
19
  EXPOSE 8000
20
  EXPOSE 8501
21
 
22
+ # Run both FastAPI and Streamlit
23
  CMD uvicorn streamlit_app.main_api:app --host 0.0.0.0 --port 8000 & \
24
  streamlit run streamlit_app/app.py --server.port 8501
25
 
26
 
27
+