ojuso-map/Dockerfile
2017-05-18 23:51:17 +02:00

53 lines
1.4 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"]
RUN apt-get update && apt-get install -y\
build-essential\
libgdal-dev\
libpq-dev\
python\
python3-dev\
python3\
rsync\
wget
# 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 apt-get install python3-pip -y \
&& python3 -m pip install -r requirements.txt
# APP
WORKDIR /app
COPY . .
EXPOSE 8000
CMD [ "python3", "manage.py", "migrate", "&&", \
"python3", "manage.py", "runserver", "0.0.0.0:8000" ]