Dockerfile 1.27 KB
Newer Older
1 2 3 4 5 6 7 8 9
FROM python:3.8-buster

ARG UMAP_VERSION=1.2.1

ENV PYTHONUNBUFFERED=1 \
    UMAP_SETTINGS=/srv/umap/settings.py \
    PORT=8000

# Create a user account and group to run uMap
10
RUN mkdir -p /srv/umap/static /srv/umap/uploads && \
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    groupadd --gid 10001 umap && \
    useradd --no-create-home --uid 10001 --gid 10001 --home-dir /srv/umap umap

# Install dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        binutils \
        libproj-dev \
        gdal-bin \
        build-essential \
        curl \
        libpq-dev \
        postgresql-client \
        gettext \
        libffi-dev \
        libtiff5-dev \
        libjpeg62-turbo-dev \
        zlib1g-dev \
        libfreetype6-dev \
        liblcms2-dev \
        libwebp-dev \
        unzip && \
    apt-get autoremove -y && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /srv/umap

COPY requirements-docker.txt .

# Get uMap
42
RUN pip install umap-project==${UMAP_VERSION}
43 44

# Install Docker dependencies
45
RUN pip install -r requirements-docker.txt
46 47

COPY settings.py .
48
COPY entrypoint.sh .
49 50

RUN chmod +x entrypoint.sh
51
RUN chown -R 10001:10001 /srv/umap
52 53 54 55 56 57 58

USER umap

EXPOSE 8000

ENTRYPOINT [ "/srv/umap/entrypoint.sh" ]
CMD [ "umap",  "runserver",  "0.0.0.0:8000" ]