-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (35 loc) · 1.42 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
ARG DATAPUSHER_USER=datapusher
FROM python:3.8-slim as datapusher
ARG DATAPUSHER_USER
RUN apt update
RUN apt install -y git build-essential
RUN useradd -m ${DATAPUSHER_USER}
USER ${DATAPUSHER_USER}
RUN pip install --user uwsgi xlrd==1.2.0
RUN pip install --user -r "https://raw.githubusercontent.com/Georepublic/datapusher/master/requirements.txt"
RUN pip install --user "git+https://github.com/Georepublic/datapusher.git@for_docker#egg=datapusher"
FROM python:3.8-slim
ARG DATAPUSHER_USER
ENV PYTHONUNBUFFERED 1
ENV PATH /home/${DATAPUSHER_USER}/.local/bin:${PATH}
ENV GITHUB_URL https://raw.githubusercontent.com/Georepublic/datapusher/for_docker
RUN apt update \
&& apt install -y \
locales \
libxslt1-dev \
libxml2-dev \
libffi-dev \
libmagic-dev \
&& rm -rf /var/lib/apt/lists/*
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
RUN locale-gen
RUN useradd -m ${DATAPUSHER_USER}
USER ${DATAPUSHER_USER}
COPY --from=datapusher --chown=${DATAPUSHER_USER}:${DATAPUSHER_USER} /home/${DATAPUSHER_USER}/.local /home/${DATAPUSHER_USER}/.local
COPY --chown=${DATAPUSHER_USER}:${DATAPUSHER_USER} datapusher-uwsgi.ini /home/${DATAPUSHER_USER}
ADD --chown=${DATAPUSHER_USER}:${DATAPUSHER_USER} \
${GITHUB_URL}/deployment/datapusher.wsgi \
${GITHUB_URL}/deployment/datapusher_settings.py \
/home/${DATAPUSHER_USER}/
EXPOSE 8800
CMD [ "uwsgi", "--http", "0.0.0.0:8800", "-i", "/home/datapusher/datapusher-uwsgi.ini" ]