-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ubuntu
More file actions
40 lines (28 loc) · 1.33 KB
/
Dockerfile.ubuntu
File metadata and controls
40 lines (28 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM ubuntu:18.04
LABEL maintainer="wuyue92tree@163.com"
WORKDIR /data/src
# 替换源
RUN sed -i s@/archive.ubuntu.com/@/mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list
RUN sed -i s@/security.ubuntu.com/@/mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y && apt-get clean
# 安装python3.7
RUN apt-get install -y curl python3.7 python3.7-dev python3.7-distutils && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 &&\
update-alternatives --set python /usr/bin/python3.7 && \
curl -s https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py --force-reinstall && \
rm get-pip.py
# 设置locales & 时区
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y locales tzdata build-essential && \
locale-gen zh_CN.UTF-8 && \
update-locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8 && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
RUN rm -rf ~/.cache/pip
COPY supervisor.conf /etc/supervisor/supervisor.conf
WORKDIR /data/src
EXPOSE 9001
CMD supervisord -nc /etc/supervisor/supervisor.conf