Skip to content
Snippets Groups Projects
Dockerfile 2.17 KiB
Newer Older
FROM ubuntu:focal

MAINTAINER Dariusz Czerski <dcz@ipipan.waw.pl>

ENV DEBIAN_FRONTEND=noninteractive \
    LANG=en_US.UTF-8 \
    LC_ALL=en_US.UTF-8 \
    LANGUAGE=en_US:en \
    TZ=Europe/Warsaw \
    PYTHONUNBUFFERED=1 \
    PYTHONFAULTHANDLER=1

ENV PACKAGES="\
    binutils \
    curl \
    gdal-bin \
    gettext \
    git \
    libproj-dev \
    locales \
    nginx \
    postgresql-client \
    python3-pip \
    python3-setuptools \
    python3-wheel \
    python3.8 \
    python3.8-dev \
    syslinux \
    tar \
    tzdata \
    unzip \
    wget \
    "

ENV DEV_PACKAGES="\
    gpg-agent \
    libcurl4-openssl-dev \
    libssl-dev \
    software-properties-common \
    "

ADD requirements.txt /requirements.txt

RUN echo $TZ > /etc/timezone && \
    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
    apt update && \
    apt install -y -f --no-install-recommends $PACKAGES $DEV_PACKAGES && \
    update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 && \
    update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \
    sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    echo "LC_ALL=$LC_ALL" >> /etc/environment && \
    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
    echo "LANG=$LANG" > /etc/locale.conf && \
    locale-gen $LANG && \
    pip install -r /requirements.txt && \
    wget -O - http://download.sgjp.pl/apt/sgjp.gpg.key | apt-key add - && \
    apt-add-repository http://download.sgjp.pl/apt/ubuntu && \
    apt update && \
    apt install -y -f --no-install-recommends morfeusz2 && \
    wget http://download.sgjp.pl/morfeusz/20211017/Linux/20.04/64/morfeusz2-1.99.1-20211017-cp35.cp36.cp37.cp38.cp39-abi3-linux_x86_64.whl && \
    pip install morfeusz2-1.99.1-20211017-cp35.cp36.cp37.cp38.cp39-abi3-linux_x86_64.whl && \
    rm morfeusz2-1.99.1-20211017-cp35.cp36.cp37.cp38.cp39-abi3-linux_x86_64.whl && \
    mkdir /run/nginx/ && \
    apt purge $DEV_PACKAGES -y && \
    apt autoremove --purge -y && \
    rm -rf /root/.cache/ && \
    rm -rf /usr/src/ && \
    rm -rf /var/lib/apt/lists/*


ADD docker/config/uwsgi.ini /uwsgi.ini
ADD . /app

VOLUME /app
WORKDIR /app

ENTRYPOINT ["/app/docker/scripts/docker-entrypoint"]