-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
88 lines (75 loc) · 2.49 KB
/
Dockerfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
FROM python:3.7.3-slim-stretch
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && apt-get install -y \
procps \
curl \
unzip \
vim \
nano \
netcat \
libreadline7 \
libgdbm3 \
libexpat1 \
net-tools \
git \
ca-certificates
RUN apt-get -y update && apt-get install -y \
libpcre3-dev \
zlib1g-dev \
libssl-dev \
libreadline-dev \
libncursesw5-dev \
libncurses5-dev \
libffi-dev \
libbz2-dev \
liblzma-dev \
libexpat1-dev \
libgdbm-dev \
tcl-dev \
tk-dev \
gnupg \
dirmngr \
dnsutils \
dh-autoreconf \
build-essential
RUN curl -L -o /tmp/nginx.tar.gz https://nginx.org/download/nginx-1.16.0.tar.gz \
&& tar -zxf /tmp/nginx.tar.gz -C /tmp/ \
&& mv /tmp/nginx-1.16.0 /tmp/nginx \
&& cd /tmp/nginx \
&& sed -i 's/Server: nginx/Server: require.id/' src/http/ngx_http_header_filter_module.c \
&& ./configure --with-http_ssl_module --with-http_v2_module --with-http_realip_module \
&& make \
&& make install \
&& rm -rf /tmp/nginx /tmp/nginx.tar.gz \
&& adduser --disabled-login --shell /bin/true nginx \
&& mkdir -p /run/nginx \
&& chown nginx:nginx /run/nginx
RUN curl -L -o /tmp/get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/0.12.17/get-poetry.py \
&& python /tmp/get-poetry.py --yes --version 0.12.17 \
&& rm -f /tmp/get-poetry.py \
&& mv /root/.poetry /usr/local/lib/poetry \
&& (echo 'python /usr/local/lib/poetry/bin/poetry "$@"' > /usr/local/bin/poetry) \
&& chmod +x /usr/local/bin/poetry \
&& ln -s /usr/local/bin/poetry /usr/bin/poetry \
&& poetry config settings.virtualenvs.create 0
ADD utils/nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
ADD utils/init.d/nginx /etc/init.d/nginx
ADD utils/dotfiles/bashrc /root/.bashrc
ADD utils/dotfiles/vimrc /etc/vim/vimrc
ADD utils/dotfiles/vimrc /root/.vimrc
ADD utils/bin/start-service /bin/start-service
RUN chmod +x /etc/init.d/nginx /bin/start-service
RUN service nginx start
RUN rm -f /run/nginx.pid
EXPOSE 80
RUN mkdir -p /root/.ssh
RUN (host=github.com; ssh-keyscan -H $host; for ip in $(dig @1.1.1.1 github.com +short); do ssh-keyscan -H $host,$ip; ssh-keyscan -H $ip; done) 2> /dev/null >> /root/.ssh/known_hosts
ENTRYPOINT ["/bin/start-service"]
WORKDIR /
COPY poetry.lock pyproject.toml ./
RUN poetry install
#RUN poetry install --no-dev
ADD app /app
WORKDIR /app
ENV PYTHONPATH=src
CMD tomodachi run src/service/app.py