You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
616 B
Docker
29 lines
616 B
Docker
11 months ago
|
FROM python:3.7
|
||
|
|
||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||
|
# 安装netcat
|
||
|
RUN apt-get update
|
||
|
|
||
|
# 可选:设置镜像源为国内
|
||
|
COPY pip.conf /root/.pip/pip.conf
|
||
|
|
||
|
# 容器内创建 myproject 文件夹
|
||
|
ENV APP_HOME=/home/myproject
|
||
|
RUN mkdir -p $APP_HOME
|
||
|
|
||
|
WORKDIR $APP_HOME
|
||
|
|
||
|
# 将当前目录加入到工作目录中(. 表示当前目录)
|
||
|
ADD . $APP_HOME
|
||
|
|
||
|
# 更新pip版本
|
||
|
RUN /usr/local/bin/python -m pip install --upgrade pip
|
||
|
|
||
|
# 安装vim
|
||
|
RUN apt-get install -y vim
|
||
|
|
||
|
# 安装项目依赖
|
||
|
RUN pip install -r requirements.txt
|
||
|
|
||
|
CMD ["sh", "-c", "$APP_HOME/restart_service.sh & python main.py"]
|