[openstreetmap/openstreetmap-website] [WIP] Add docker support (#2272)

Fazle Rabbi notifications at github.com
Thu Jun 20 07:51:38 UTC 2019

fazlerabbi37 commented on this pull request.

> @@ -0,0 +1,25 @@
+FROM ruby:2.5-slim
+#install packages
+#fixes dpkg man page softlink error while installing postgresql-client [source: https://github.com/debuerreotype/debuerreotype/issues/10#issuecomment-438342078]
+RUN mkdir -p /usr/share/man/man1 && mkdir -p /usr/share/man/man7
+RUN apt-get update && apt-get install curl -y
+RUN curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh && bash nodesource_setup.sh && rm nodesource_setup.sh
+RUN apt-get install -y --no-install-recommends ruby-dev libarchive-dev libmagickwand-dev libxml2-dev libxslt1-dev build-essential libpq-dev libsasl2-dev imagemagick libffi-dev locales postgresql-client-9.6 nodejs && apt-get clean && rm -rf /var/lib/apt/lists/*

> This all looks horribly wrong anyway - why is is creating directories by hand?

as I have mentioned on the comment above the command, while installing `postgresql-client`, because `update-alternatives` can't create symbolic link, `dpkg` throws an error and exits with code 100. A quick search pointed to [this](https://stackoverflow.com/a/52655008/5350059) stack answer which solves the problem. 

> And downloading and installing node from upstream using a dodgy "run this shell script as root" install method isn't going to fly. Why not just use the ubuntu packaged one?

the image `ruby:2.5-slim` usages  Debian 9 (stretch) as base image. Though I could install `nodejs` using the office Debian repo , I couldn't install `npm` using the `apt-get` command as it gives `E: Unable to locate package npm` error. I followed the official download [instruction](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions-enterprise-linux-fedora-and-snap-packages) which leads to NodeSource's GitHub [instruction](https://github.com/nodesource/distributions/blob/master/README.md#debinstall) and installed `nodejs` and `npm`. 

If there is any better way to solve this, I would be happy to hear. :blush: 

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190620/dee84d0e/attachment-0001.html>

More information about the rails-dev mailing list