Create Dockerfile
Browse files- Dockerfile +34 -0
Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM centos:latest
|
| 2 |
+
|
| 3 |
+
# 安装必要的软件包
|
| 4 |
+
RUN yum -y update && \
|
| 5 |
+
yum -y install epel-release && \
|
| 6 |
+
yum -y install wget curl git
|
| 7 |
+
|
| 8 |
+
# 安装 Node.js
|
| 9 |
+
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
|
| 10 |
+
yum -y install nodejs
|
| 11 |
+
|
| 12 |
+
# 安装 Python 3.9
|
| 13 |
+
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
|
| 14 |
+
yum -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm && \
|
| 15 |
+
yum -y module reset php && \
|
| 16 |
+
yum -y module enable php:remi-7.4 && \
|
| 17 |
+
yum -y install php php-cli php-common php-devel php-json php-mbstring php-pdo php-xml php-zip && \
|
| 18 |
+
yum -y install python39 python39-devel python39-pip
|
| 19 |
+
|
| 20 |
+
# 设置工作目录
|
| 21 |
+
WORKDIR /app
|
| 22 |
+
|
| 23 |
+
# 复制应用程序代码
|
| 24 |
+
COPY . .
|
| 25 |
+
|
| 26 |
+
# 安装依赖包
|
| 27 |
+
RUN npm install && \
|
| 28 |
+
pip3 install -r requirements.txt
|
| 29 |
+
|
| 30 |
+
# 暴露端口
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
# 设置入口点
|
| 34 |
+
CMD [ "python3", "app.py" ]
|