-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (47 loc) · 1.54 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
FROM alpine:3.13
MAINTAINER Open Knowledge Foundation
ENV APP_DIR=/srv/app
ENV GIT_BRANCH 0.0.17
ENV GIT_URL https://github.com/ckan/datapusher.git
ENV JOB_CONFIG ${APP_DIR}/datapusher_settings.py
WORKDIR ${APP_DIR}
RUN apk add --no-cache \
python3 \
py3-pip \
py3-wheel \
libffi-dev \
libressl-dev \
libxslt \
uwsgi \
uwsgi-http \
uwsgi-corerouter \
uwsgi-python \
# Temporary packages to build DataPusher requirements
&& apk add --no-cache --virtual .build-deps \
gcc \
git \
musl-dev \
python3-dev \
libxml2-dev \
libxslt-dev \
libmagic \
openssl-dev \
cargo
RUN mkdir ${APP_DIR}/src && cd ${APP_DIR}/src && \
git clone -b ${GIT_BRANCH} --depth=1 --single-branch ${GIT_URL} && \
cd datapusher && \
python3 setup.py install && \
pip3 install --no-cache-dir -r requirements.txt
RUN apk del .build-deps && \
cp ${APP_DIR}/src/datapusher/deployment/*.* ${APP_DIR} && \
# Remove default values in ini file
sed -i '/http/d' ${APP_DIR}/datapusher-uwsgi.ini && \
sed -i '/wsgi-file/d' ${APP_DIR}/datapusher-uwsgi.ini && \
sed -i '/virtualenv/d' ${APP_DIR}/datapusher-uwsgi.ini && \
rm -rf ${APP_DIR}/src
# Create a local user and group to run the app
RUN addgroup -g 92 -S www-data && \
adduser -u 92 -h /srv/app -H -D -S -G www-data www-data
EXPOSE 8800
CMD ["sh", "-c", \
"uwsgi --plugins=http,python --http=0.0.0.0:8800 --socket=/tmp/uwsgi.sock --ini=`echo ${APP_DIR}`/datapusher-uwsgi.ini --wsgi-file=`echo ${APP_DIR}`/datapusher.wsgi"]