-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.prod
More file actions
70 lines (59 loc) · 2.12 KB
/
Dockerfile.prod
File metadata and controls
70 lines (59 loc) · 2.12 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
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
FROM python:3.7.3-alpine3.9
MAINTAINER Jason Zhu <jason.zhuyx@gmail.com>
LABEL maintainer="jason.zhuyx@gmail.com"
LABEL organization="Dockerian"
LABEL project="pyml"
# some packages require gcc, libc-dev, libev-dev, libffi-dev, and mariadb-dev
RUN apk update \
&& apk upgrade \
&& apk add --no-cache --virtual .build-deps \
bash \
ca-certificates \
dpkg \
gcc \
groff \
less \
libc-dev \
libev-dev \
libffi-dev \
mariadb-dev \
nginx \
make \
tree \
tar \
zip \
&& rm -rf /tmp/* \
&& rm -rf /var/cache/apk/* \
&& rm /bin/sh && ln -sf /bin/bash /bin/sh \
&& echo "export PS1='\n\u@\h [\w] \D{%F %T} [\#]:\n\$ '" >> ~/.bashrc \
&& echo "alias ll='ls -al'" >> ~/.bashrc \
&& echo "alias apkinfo='apk info -a --no-cache 2>/dev/null|grep ^[a-z]|xargs -n1 -I{} apk info --no-cache -s {} 2>/dev/null|grep -v fetch|xargs -n4|awk '\"'\"'{print \$4 \"\\t\" \$1}'\"'\"'|sort -rn'" >> ~/.bashrc \
&& echo "" >> ~/.bashrc \
&& echo "# apk info -a --no-cache 2>/dev/null|grep ^[a-z]|xargs -n1 -I{} apk info --no-cache -s {} 2>/dev/null|grep -v fetch|xargs -n4|awk '{print \$4 \"\\t\" \$1}'|sort -rn" >> ~/.bashrc \
&& echo "" >> ~/.bashrc
# install gosu for a better su+exec command
# ARG GOSU_VERSION=1.10
# RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
# && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
# && chmod +x /usr/local/bin/gosu \
# && gosu nobody true
# COPY tools/entrypoint.sh /usr/local/bin/entrypoint.sh
ENV PROJECT=pyml \
PROJECT_DIR=ml \
PYTHONPATH=src/pyml \
SHELL=/bin/bash \
SOURCE=/src
COPY . $SOURCE/$PROJECT/
COPY tools/nginx.conf /etc/nginx/conf.d/default.conf
# install python dependencies, and aws cli
RUN mkdir -p $SOURCE \
&& pip install --upgrade pip \
&& pip install -r $PYTHONPATH/$PROJECT_DIR/requirements-api.txt \
#&& pip install -r $PYTHONPATH/$PROJECT_DIR/requirements.txt \
#&& pip install awscli \
&& pip list
WORKDIR $SOURCE/$PROJECT
# ENTRYPOINT ["/bin/bash", "-c"]
# ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 80/TCP 8081/TCP
CMD ["/bin/bash"]