-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_old
55 lines (40 loc) · 1.3 KB
/
Dockerfile_old
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
FROM ubuntu:bionic
# Update base container install
RUN apt-get update
RUN apt-get upgrade -y
# Install GDAL dependencies
RUN apt-get install -y python3-pip libgdal-dev locales
# Install dependencies for other packages
RUN apt-get install gcc g++
#RUN apt-get install jpeg-dev zlib-dev
# Ensure locales configured correctly
RUN locale-gen en_US.UTF-8
ENV LC_ALL='en_US.utf8'
# Set python aliases for python3
RUN echo 'alias python=python3' >> ~/.bashrc
RUN echo 'alias pip=pip3' >> ~/.bashrc
# Update C env vars so compiler can find gdal
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
ENV C_INCLUDE_PATH=/usr/include/gdal
# This will install latest version of GDAL
RUN apt-get -y install python3-gdal
RUN apt-get -y install zip
RUN apt-get install ca-certificates
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Copy function to a path
RUN mkdir -p /var/cog_api
COPY . /var/cog_api/
# Work Directory
WORKDIR /var/cog_api/
# Build context
ADD app.py src /
ENV PYTHONUNBUFFERED = '1'
# Upgrading pip
RUN python3 -m pip install pip --upgrade
RUN python3 -m pip install wheel
# Install dependencies for tiling
RUN pip install -r requirements.txt
EXPOSE 4000
# CMD ["python3", "app.py" ]
CMD ["gunicorn", "-k", "gevent", "-w", "8", "-b", "0.0.0.0:4000", "wsgi:app"]
# CMD ["gunicorn", "-c", "gconfig.py", "wsgi:app"]