chb2024 commited on
Commit
344eaf5
·
verified ·
1 Parent(s): 5692d6e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -15
Dockerfile CHANGED
@@ -1,43 +1,49 @@
1
- # Use Ubuntu as the base image
2
  FROM ubuntu:latest
3
 
4
- # Update package lists and install necessary packages
5
  RUN apt-get update && \
6
  dpkg --add-architecture i386 && \
7
  apt-get install -y \
8
  wget \
9
  tar \
10
- wine-stable \
11
- wine32:i386 \
12
  nodejs \
13
- npm \
14
- && rm -rf /var/lib/apt/lists/*
15
 
16
- # Configure Wine
17
- RUN winecfg
 
 
 
18
 
19
- # Download and install the latest version of lolMiner
 
 
 
 
 
 
20
  RUN wget https://github.com/Lolliedieb/lolMiner-releases/releases/download/1.94/lolMiner_v1.94_Lin64.tar.gz -O lolMiner.tar.gz \
21
  && tar -xvf lolMiner.tar.gz \
22
  && mv 1.94/lolMiner /usr/local/bin/lolMiner \
23
  && rm -rf 1.94 lolMiner.tar.gz
24
 
25
- # Copy the configuration script and Node.js app into the container
26
  COPY miner-config.bat /app/miner-config.bat
27
  COPY index.js /app/index.js
28
 
29
- # Set the working directory
30
  WORKDIR /app
31
 
32
- # Install Node.js dependencies
33
  RUN npm install
34
 
35
- # Expose Hugging Face default port
36
  EXPOSE 8080
37
 
38
- # Environment variables for paths
39
  ENV LOLMINER_PATH=/usr/local/bin/lolMiner
40
  ENV MINER_CONFIG=/app/miner-config.bat
41
 
42
- # Run both the mining script and Node.js server with logging
43
  CMD ["sh", "-c", "nohup node index.js > node.log 2>&1 & wine cmd /c $MINER_CONFIG > miner.log 2>&1"]
 
1
+ # 使用Ubuntu作为基础镜像
2
  FROM ubuntu:latest
3
 
4
+ # 更新软件包列表, 添加i386架构, 并安装基本包
5
  RUN apt-get update && \
6
  dpkg --add-architecture i386 && \
7
  apt-get install -y \
8
  wget \
9
  tar \
 
 
10
  nodejs \
11
+ npm
 
12
 
13
+ # 添加WineHQ的仓库
14
+ RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key && \
15
+ apt-key add winehq.key && \
16
+ apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ noble main' && \
17
+ apt-get update
18
 
19
+ # 安装Wine稳定版(应该包含32位支持)
20
+ RUN apt-get install -y --install-recommends winehq-stable
21
+
22
+ # 配置Wine(可以帮助解决一些初始化问题)
23
+ RUN winecfg || true
24
+
25
+ # 下载并安装lolMiner
26
  RUN wget https://github.com/Lolliedieb/lolMiner-releases/releases/download/1.94/lolMiner_v1.94_Lin64.tar.gz -O lolMiner.tar.gz \
27
  && tar -xvf lolMiner.tar.gz \
28
  && mv 1.94/lolMiner /usr/local/bin/lolMiner \
29
  && rm -rf 1.94 lolMiner.tar.gz
30
 
31
+ # 复制配置文件和Node.js应用到容器中
32
  COPY miner-config.bat /app/miner-config.bat
33
  COPY index.js /app/index.js
34
 
35
+ # 设置工作目录
36
  WORKDIR /app
37
 
38
+ # 安装Node.js依赖
39
  RUN npm install
40
 
41
+ # 暴露Hugging Face默认端口
42
  EXPOSE 8080
43
 
44
+ # 设置环境变量
45
  ENV LOLMINER_PATH=/usr/local/bin/lolMiner
46
  ENV MINER_CONFIG=/app/miner-config.bat
47
 
48
+ # 运行Node.js服务器和lolMiner
49
  CMD ["sh", "-c", "nohup node index.js > node.log 2>&1 & wine cmd /c $MINER_CONFIG > miner.log 2>&1"]