Tokipo commited on
Commit
125b2d5
·
verified ·
1 Parent(s): 7907878

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -26
Dockerfile CHANGED
@@ -1,37 +1,20 @@
1
  FROM node:18-slim
2
 
3
- # Install Python and required packages
4
- RUN apt-get update && apt-get install -y \
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"}}' > 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
26
 
27
- # Copy the main application
28
  COPY app.py .
29
 
30
- # Create tmp directory with proper permissions
31
- RUN mkdir -p /tmp && chmod 777 /tmp
 
32
 
33
- # Expose port for Hugging Face Spaces
34
  EXPOSE 7860
35
 
36
- # Run the application with virtual environment
37
- CMD ["/opt/venv/bin/python", "app.py"]
 
1
  FROM node:18-slim
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
+ # Create package.json with required dependencies
6
+ RUN echo '{"name":"bot-manager","version":"1.0.0","type":"commonjs","dependencies":{"mineflayer":"^4.20.1","express":"^4.18.2","socket.io":"^4.7.2","minecraft-data":"^3.35.0","vec3":"^0.1.7"}}' > package.json
 
 
 
7
 
8
+ # Install dependencies
9
+ RUN npm install
 
 
10
 
11
+ # Copy Python app
12
  COPY app.py .
13
 
14
+ # Install Python
15
+ RUN apt-get update && apt-get install -y python3 python3-pip && rm -rf /var/lib/apt/lists/*
16
+ RUN pip3 install --break-system-packages flask requests
17
 
 
18
  EXPOSE 7860
19
 
20
+ CMD ["python3", "app.py"]