umap/Dockerfile
Yohan Boniface efdda1adac Better cache npm install in Docker build
I also add to install git, no idea why it was working before
and not after this change :/
2023-06-05 16:09:12 +02:00

73 lines
1.3 KiB
Docker

FROM node:alpine AS vendors
RUN apk add git
WORKDIR /srv/umap
COPY package.json .
RUN npm install
COPY . .
RUN npm run vendors
FROM python:3.11-slim as common
RUN apt-get update && \
apt-get install -y --no-install-recommends \
tini \
uwsgi \
sqlite3 \
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 \
build-essential \
binutils \
libproj-dev \
curl \
git \
gettext \
python3-venv \
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
EXPOSE 8000
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/srv/umap/docker/entrypoint.sh"]