This repository was archived by the owner on May 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathDockerfile
33 lines (33 loc) · 1.52 KB
/
Dockerfile
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
FROM ubuntu:16.04
#Layer for python and gdal support
RUN apt-get update && apt-get install -y software-properties-common curl \
&& add-apt-repository ppa:ubuntugis/ubuntugis-unstable && apt-get update \
&& apt-get install -y python3-pip libssl-dev libffi-dev python3-gdal \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 \
&& rm -rf /var/lib/apt/lists/*
#Begin of mandatory layers for Microsoft ODBC Driver 13 for Linux
RUN apt-get update && apt-get install -y apt-transport-https wget
RUN sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/mssql-ubuntu-xenial-release/ xenial main" > /etc/apt/sources.list.d/mssqlpreview.list'
RUN apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
RUN apt-get update -y
RUN apt-get install -y libodbc1-utf16 unixodbc-utf16 unixodbc-dev-utf16
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql
RUN apt-get install -y locales
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
RUN locale-gen
#End of mandatory layers for Microsoft ODBC Driver 13 for Linux
RUN apt-get remove -y curl
#Layers for the django app
RUN mkdir /code
WORKDIR /code
ADD . /code/
RUN ls /code/
RUN pip install pip --upgrade
RUN pip install -r /code/requirements.txt
RUN python /code/manage.py collectstatic --noinput
RUN python /code/manage.py makemigrations
RUN python /code/manage.py migrate
EXPOSE 8000
WORKDIR /code/source
ENTRYPOINT ["python", "/code/manage.py", "runserver", "0.0.0.0:8000"]