umap/Dockerfile

74 lines
1.3 KiB
Text
Raw Normal View History

FROM node:alpine AS vendors
2020-05-15 12:59:08 -05:00
RUN apk add git
2020-05-15 12:59:08 -05:00
WORKDIR /srv/umap
COPY package.json .
RUN npm install
2020-05-15 12:59:08 -05:00
COPY . .
RUN npm run vendors
2020-05-15 12:59:08 -05:00
FROM python:3.11-slim as common
2020-05-15 12:59:08 -05:00
RUN apt-get update && \
apt-get install -y --no-install-recommends \
tini \
2020-05-15 12:59:08 -05:00
uwsgi \
sqlite3 \
2020-05-15 12:59:08 -05:00
libpq-dev \
gdal-bin \
&& \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
FROM common as build
RUN apt-get update && \
apt-get install -y --no-install-recommends \
2020-05-15 12:59:08 -05:00
build-essential \
binutils \
libproj-dev \
curl \
git \
gettext \
python3-venv \
2020-05-15 12:59:08 -05:00
libffi-dev \
libtiff5-dev \
libjpeg62-turbo-dev \
zlib1g-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev
RUN python -m venv /venv
WORKDIR /srv/umap
COPY . /srv/umap
RUN /venv/bin/pip install .[docker]
FROM common
COPY --from=build /srv/umap/docker/ /srv/umap/docker/
COPY --from=build /venv/ /venv/
COPY --from=vendors /srv/umap/umap/static/umap/vendors /srv/umap/umap/static/umap/vendors
WORKDIR /srv/umap
RUN mkdir -p /srv/umap/uploads
ENV PYTHONUNBUFFERED=1 \
PORT=8000
2020-05-15 12:59:08 -05:00
EXPOSE 8000
ENTRYPOINT ["/usr/bin/tini", "--"]
2020-05-15 12:59:08 -05:00
CMD ["/srv/umap/docker/entrypoint.sh"]