-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
137 lines (114 loc) · 3.43 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
ARG version=3.12
ARG suffix=""
FROM minidocks/base:3.19 AS base_3.11
FROM minidocks/base:3.19-build AS base_3.11-build
FROM minidocks/base:3.20 AS base_3.12
FROM minidocks/base:3.20-build AS base_3.12-build
FROM base_$version$suffix AS latest
LABEL maintainer="Martin Hasoň <[email protected]>"
ARG version
ENV PIP_NO_COMPILE=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_CACHE_DIR=/pip-cache \
PIPENV_VENV_IN_PROJECT=1 \
CLEAN="$CLEAN:\$PIP_CACHE_DIR/:pyclean"
COPY rootfs /
# make some useful symlinks that are expected to exist
RUN ln -s /usr/bin/python3 /usr/bin/python; \
ln -s /usr/bin/pip3 /usr/bin/pip; \
ln -s /usr/bin/easy_install-$version /usr/bin/easy_install; \
ln -s /usr/bin/pydoc3 /usr/bin/pydoc; \
ln -s /usr/bin/python3-config /usr/bin/python-config;
RUN mkdir "$PIP_CACHE_DIR" && chmod a+rwx "$PIP_CACHE_DIR" \
&& apk add python3 && rm -rf /usr/lib/python*/EXTERNALLY-MANAGED \
&& python3 -m ensurepip --upgrade \
&& pip install -U pip setuptools wheel pipx \
&& clean
RUN pip install micropipenv[toml] && clean
CMD [ "python" ]
FROM latest AS packaging
ARG version
RUN apk add py3-cryptography && pip install flit poetry virtualenv pipenv twine && clean
FROM packaging AS build
ARG version
RUN apk -U add python3-dev libffi-dev openssl-dev && clean
FROM latest AS uwsgi
LABEL maintainer="Martin Hasoň <[email protected]>"
RUN apk --update --no-cache add nginx \
uwsgi \
uwsgi-alarm_curl \
uwsgi-cache \
uwsgi-carbon \
uwsgi-cgi \
uwsgi-cheaper_backlog2 \
uwsgi-cheaper_busyness \
uwsgi-corerouter \
uwsgi-curl_cron \
uwsgi-dumbloop \
uwsgi-dummy \
uwsgi-echo \
uwsgi-emperor_amqp \
uwsgi-emperor_pg \
uwsgi-emperor_zeromq \
uwsgi-fastrouter \
uwsgi-forkptyrouter \
uwsgi-geoip \
uwsgi-gevent \
uwsgi-gevent3 \
uwsgi-graylog2 \
uwsgi-http \
uwsgi-legion_cache_fetch \
uwsgi-logcrypto \
uwsgi-logfile \
uwsgi-logpipe \
uwsgi-logsocket \
uwsgi-logzmq \
uwsgi-lua \
uwsgi-msgpack \
uwsgi-nagios \
uwsgi-notfound \
uwsgi-pam \
uwsgi-ping \
uwsgi-pty \
uwsgi-python3 \
uwsgi-rawrouter \
uwsgi-redislog \
uwsgi-router_basicauth \
uwsgi-router_cache \
uwsgi-router_expires \
uwsgi-router_hash \
uwsgi-router_http \
uwsgi-router_memcached \
uwsgi-router_metrics \
uwsgi-router_radius \
uwsgi-router_redirect \
uwsgi-router_redis \
uwsgi-router_rewrite \
uwsgi-router_static \
uwsgi-router_uwsgi \
uwsgi-rpc \
uwsgi-rrdtool \
uwsgi-rsyslog \
uwsgi-signal \
uwsgi-spooler \
uwsgi-sslrouter \
uwsgi-stats_pusher_file \
uwsgi-stats_pusher_socket \
uwsgi-stats_pusher_statsd \
uwsgi-symcall \
uwsgi-syslog \
uwsgi-transformation_chunked \
uwsgi-transformation_gzip \
uwsgi-transformation_offload \
uwsgi-transformation_template \
uwsgi-transformation_tofile \
uwsgi-tuntap \
uwsgi-ugreen \
uwsgi-webdav \
uwsgi-xslt \
uwsgi-zabbix \
uwsgi-zergpool \
&& clean
COPY rootfs-uwsgi /
CMD [ "uwsgi", "--ini", "/etc/uwsgi/uwsgi.ini" ]
FROM latest