Tokipo commited on
Commit
ad8831a
·
verified ·
1 Parent(s): ab0b79d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -5,19 +5,24 @@ RUN apt-get update && apt-get install -y \
5
  python3 \
6
  python3-pip \
7
  python3-venv \
 
 
 
8
  curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  WORKDIR /app
12
 
13
- # Create package.json for Node dependencies
14
- RUN echo '{"name":"mineflayer-bot","version":"1.0.0","dependencies":{"mineflayer":"^4.14.0","express":"^4.18.2","socket.io":"^4.5.4","axios":"^1.6.0"}}' > package.json
15
 
16
  # Install Node dependencies
17
- RUN npm install
18
 
19
- # Install Python dependencies
20
- RUN pip3 install --no-cache-dir flask flask-cors requests pandas
 
 
21
 
22
  # Copy the main application
23
  COPY app.py .
@@ -25,5 +30,5 @@ COPY app.py .
25
  # Expose port for Hugging Face Spaces
26
  EXPOSE 7860
27
 
28
- # Run the application
29
- CMD ["python3", "app.py"]
 
5
  python3 \
6
  python3-pip \
7
  python3-venv \
8
+ python3-flask \
9
+ python3-requests \
10
+ python3-pandas \
11
  curl \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  WORKDIR /app
15
 
16
+ # Create package.json for Node dependencies with fixed versions
17
+ RUN echo '{"name":"mineflayer-bot","version":"1.0.0","dependencies":{"mineflayer":"^4.20.0","express":"^4.18.2","axios":"^1.6.0"}}' > package.json
18
 
19
  # Install Node dependencies
20
+ RUN npm install --omit=dev
21
 
22
+ # Create Python virtual environment and install packages
23
+ RUN python3 -m venv /opt/venv
24
+ ENV PATH="/opt/venv/bin:$PATH"
25
+ RUN pip install --no-cache-dir flask flask-cors requests pandas
26
 
27
  # Copy the main application
28
  COPY app.py .
 
30
  # Expose port for Hugging Face Spaces
31
  EXPOSE 7860
32
 
33
+ # Run the application with virtual environment
34
+ CMD ["/opt/venv/bin/python", "app.py"]