-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (45 loc) · 1.37 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
FROM python:3.6.2-stretch
MAINTAINER Enrique Cornejo enrique.cornejo@vizzuality.com
ENV NAME nexgddp
ENV USER nexgddp
RUN apt-get update && apt-get install -yq \
gcc \
bash \
git \
build-essential \
libcurl4-openssl-dev \
libffi-dev \
libjpeg-dev \
libpq-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
libgdal-dev \
gdal-bin \
make \
libpng-dev \
cmake
ENV CPLUS_INCLUDE_PATH /usr/include/gdal
ENV C_INCLUDE_PATH /usr/include/gdal
RUN groupadd $USER && useradd -g $USER $USER -s /bin/bash
RUN easy_install pip && pip install --upgrade pip
RUN pip install virtualenv gunicorn gevent numpy
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==2.1.3
RUN mkdir -p /opt/$NAME
RUN cd /opt/$NAME && virtualenv venv && /bin/bash -c "source venv/bin/activate"
COPY requirements.txt /opt/$NAME/requirements.txt
RUN cd /opt/$NAME && pip install -r requirements.txt
COPY entrypoint.sh /opt/$NAME/entrypoint.sh
COPY main.py /opt/$NAME/main.py
COPY test.py /opt/$NAME/test.py
COPY gunicorn.py /opt/$NAME/gunicorn.py
# Copy the application folder inside the container
WORKDIR /opt/$NAME
COPY ./$NAME /opt/$NAME/$NAME
COPY ./microservice /opt/$NAME/microservice
RUN chown $USER:$USER /opt/$NAME
# Tell Docker we are going to use this ports
EXPOSE 3078
USER $USER
# Launch script
ENTRYPOINT ["./entrypoint.sh"]