Created
January 30, 2018 17:33
-
-
Save volkanunsal/afc67d600d4b741327090d1240f94462 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
# Install Node.js | |
RUN apt-get update -y && apt-get upgrade -y | |
RUN apt-get install --yes curl build-essential python zlib1g-dev clang make pkg-config | |
# Install Node | |
RUN curl --silent --location https://deb.nodesource.com/setup_8.x | bash - | |
RUN apt-get install --yes nodejs | |
# you might have to update your outdated clang | |
RUN apt-get install software-properties-common python-software-properties -y | |
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
RUN apt-get update -y | |
RUN apt-get install -y gcc-6 g++-6 clang-3.8 | |
ENV CXX="clang++-3.8" | |
ENV CC="clang-3.8" | |
WORKDIR / | |
# Install mapnik | |
RUN apt-get install -y git | |
RUN git clone https://github.com/mapnik/mapnik mapnik-3.x --depth 10 | |
WORKDIR /mapnik-3.x | |
RUN git submodule update --init | |
RUN bash bootstrap.sh | |
RUN ./configure CUSTOM_CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" CXX=${CXX} CC=${CC} | |
RUN make | |
RUN make test | |
RUN make install | |
RUN mkdir /webapp | |
WORKDIR /webapp | |
# Install packages using Yarn | |
ADD webapp/package.json webapp/yarn.lock /tmp/ | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | |
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | |
RUN apt-get update -y && apt-get install yarn | |
RUN cd /tmp && yarn install --ignore-optional --ignore-scripts | |
RUN ln -s /tmp/node_modules | |
RUN yarn cache clean | |
RUN apt-get clean | |
CMD ["node", "-p", "require('mapnik')"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment