-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfileGdal
45 lines (34 loc) · 1.21 KB
/
DockerfileGdal
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
#### Use latest Ubuntu
FROM ubuntu:focal
# Update base container install
RUN apt-get update
#RUN apt-get upgrade -y
ENV TZ 'GB'
RUN echo $TZ > /etc/timezone && \
apt-get install -y tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
# Install GDAL dependencies
RUN apt-get install -y python3-pip libgdal-dev locales
# Ensure locales configured correctly
RUN locale-gen en_GB.UTF-8
ENV LC_ALL='en_GB.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
RUN pip install poetry==1.3.2
RUN pip install pydantic # временно
# This will install latest version of GDAL
# Copy only requirements to cache them in docker layer
WORKDIR /app
COPY poetry.lock pyproject.toml /app/
RUN poetry export --without-hashes --format=requirements.txt > requirements.txt
RUN pip install -r requirements.txt
# Project initialization:
#RUN poetry config virtualenvs.create false \
# && poetry install --only main --no-interaction --no-ansi