2017-05-18 21:51:17 +00:00
|
|
|
FROM debian:9
|
|
|
|
|
|
|
|
# The Dockerfile for this project is split into 5 layers.
|
|
|
|
# - Base: The base image
|
|
|
|
# - System: System package installation
|
|
|
|
# - Compile: Custom compilation and installation
|
|
|
|
# - Packages: Application packages (e.g. npm, pip etc)
|
|
|
|
# - App: Task runs and application prep
|
|
|
|
# The order of the layers is based on which parts are likely to be
|
|
|
|
# modified the most.
|
|
|
|
# The project source is added in the App layer so as not to invalidate
|
|
|
|
# the Dockerfile cache.
|
|
|
|
|
|
|
|
# SYSTEM
|
|
|
|
SHELL ["/bin/bash","-ex","-c"]
|
2017-05-20 23:55:40 +00:00
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
2017-05-18 21:51:17 +00:00
|
|
|
RUN apt-get update && apt-get install -y\
|
|
|
|
build-essential\
|
2017-05-22 23:13:43 +00:00
|
|
|
cron\
|
2017-05-20 23:55:40 +00:00
|
|
|
locales\
|
2017-05-18 21:51:17 +00:00
|
|
|
libgdal-dev\
|
|
|
|
libpq-dev\
|
|
|
|
python\
|
|
|
|
python3-dev\
|
2017-05-20 23:55:40 +00:00
|
|
|
python3-pip\
|
2017-05-18 21:51:17 +00:00
|
|
|
python3\
|
|
|
|
rsync\
|
2017-05-20 23:55:40 +00:00
|
|
|
virtualenv\
|
|
|
|
wget\
|
|
|
|
&& echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen\
|
|
|
|
&& locale-gen en_GB.UTF-8\
|
|
|
|
&& dpkg-reconfigure locales\
|
|
|
|
&& /usr/sbin/update-locale LANG=en_GB.UTF-8
|
|
|
|
ENV LC_ALL en_GB.UTF-8
|
2017-05-18 21:51:17 +00:00
|
|
|
|
|
|
|
# COMPILE
|
|
|
|
WORKDIR /build
|
|
|
|
RUN wget https://nodejs.org/dist/v7.10.0/node-v7.10.0-linux-x64.tar.gz\
|
|
|
|
&& tar -xvf node-v7.10.0-linux-x64.tar.gz\
|
|
|
|
&& pushd node-v7.10.0-linux-x64\
|
|
|
|
&& rsync --archive ./* /usr/local\
|
|
|
|
&& popd\
|
|
|
|
&& wget http://download.osgeo.org/proj/proj-4.9.1.tar.gz\
|
|
|
|
&& wget http://download.osgeo.org/proj/proj-datumgrid-1.5.tar.gz\
|
|
|
|
&& tar -xvf proj-4.9.1.tar.gz && cd proj-4.9.1/nad\
|
|
|
|
&& tar -xvf ../../proj-datumgrid-1.5.tar.gz && cd ../ \
|
|
|
|
&& ./configure && make && make install
|
|
|
|
|
|
|
|
# PACKAGES
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./requirements.txt .
|
2017-05-20 23:55:40 +00:00
|
|
|
RUN python3 -m pip install -r requirements.txt
|
2017-05-18 21:51:17 +00:00
|
|
|
|
|
|
|
# APP
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
2017-05-22 23:13:43 +00:00
|
|
|
COPY ./support/cron/* /etc/cron.d/
|
|
|
|
RUN chmod 0644 /etc/cron.d/*\
|
|
|
|
&& touch /var/log/cron.log
|
2017-05-18 21:51:17 +00:00
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
CMD [ "python3", "manage.py", "migrate", "&&", \
|
|
|
|
"python3", "manage.py", "runserver", "0.0.0.0:8000" ]
|