ojuso-map/Dockerfile
2017-06-16 18:10:44 +02:00

66 lines
1.8 KiB
Docker

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"]
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y\
build-essential\
closure-compiler\
cron\
locales\
libgdal-dev\
libpq-dev\
python\
python3-dev\
python3-pip\
python3\
rsync\
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
# 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 .
RUN python3 -m pip install -r requirements.txt
# APP
WORKDIR /app
COPY . .
COPY ./support/cron/* /etc/cron.d/
RUN chmod 0644 /etc/cron.d/*\
&& touch /var/log/cron.log
EXPOSE 8000
CMD [ "python3", "manage.py", "migrate", "&&", \
"python3", "manage.py", "runserver", "0.0.0.0:8000" ]