Skip to content

Commit

Permalink
Update Ruby version
Browse files Browse the repository at this point in the history
Set ubuntu 20.04

Add missing libs

Add libv8-dev

Update ruby version

Fix web continaer
  • Loading branch information
Rub21 committed Dec 15, 2023
1 parent 1c74419 commit fb6f57e
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions images/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
ENV workdir /var/www
ENV RUBY_MAJOR 3.0
ARG RUBY_VERSION=3.0.6
ENV RUBY_VERSION $RUBY_VERSION
ENV PATH /opt/ruby/bin:$PATH:/opt/rbenv/plugins/ruby-build/bin

# ruby-build
RUN set -ex \
&& mkdir -p /etc/network/interfaces.d \
&& BaseDeps=' \
git \
gcc \
autoconf \
bison \
build-essential \
libssl-dev \
libyaml-dev \
libreadline6-dev \
zlib1g-dev \
libncurses5-dev \
libffi-dev \
libgdbm6 \
libgdbm-dev \
make \
wget \
curl \
iproute2 \
net-tools \
tzdata \
locales \
ca-certificates' \
&& apt-get update \
&& DEBCONF_NOWARNINGS=yes apt-get -y upgrade \
&& DEBCONF_NOWARNINGS=yes DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $BaseDeps \
&& rm -rf /var/lib/apt/lists/* \
&& git clone https://github.com/sstephenson/ruby-build.git /opt/rbenv/plugins/ruby-build \
&& ruby-build ${RUBY_VERSION} /opt/ruby

# Production OSM setup
ENV workdir /var/www
ENV RAILS_ENV=production

# Install the openstreetmap-website dependencies
RUN apt-get update \
&& apt-get install -y \
ruby2.7 libruby2.7 ruby2.7-dev libmagickwand-dev libxml2-dev libxslt1-dev \
nodejs npm apache2 apache2-dev build-essential git-core firefox-geckodriver postgresql-client \
libpq-dev libsasl2-dev imagemagick libffi-dev libgd-dev libarchive-dev libbz2-dev yarnpkg curl \
libmagickwand-dev libxml2-dev libxslt1-dev \
nodejs npm libv8-dev apache2 apache2-dev build-essential git-core postgresql-client \
libpq-dev libsasl2-dev imagemagick libffi-dev libgd-dev libarchive-dev libbz2-dev yarnpkg curl unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -23,7 +59,8 @@ RUN apt-get update \
libcrypto++-dev libargon2-dev libyajl-dev automake autoconf libtool \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*



# Install cgimap
ENV cgimap /tmp/openstreetmap-cgimap
RUN git clone -b master https://github.com/zerebubuth/openstreetmap-cgimap.git $cgimap
Expand All @@ -40,7 +77,7 @@ RUN npm install -g svgo

# Install openstreetmap-website
RUN rm -rf $workdir/html
# GITSHA value at 15-02-2022

ENV OPENSTREETMAP_WEBSITE_GITSHA=c24b5481812aba9e83da1fd855ccb37f92c5d75e
RUN curl -L https://github.com/openstreetmap/openstreetmap-website/archive/$OPENSTREETMAP_WEBSITE_GITSHA.zip --output website.zip && unzip website.zip
RUN mv openstreetmap-website-$OPENSTREETMAP_WEBSITE_GITSHA/* $workdir/
Expand All @@ -50,6 +87,7 @@ RUN echo "gem 'image_optim_pack', :git => 'https://github.com/toy/image_optim_pa
# Install Ruby packages
RUN gem install bundler && bundle install


# Configure database.yml and secrets.yml
RUN cp $workdir/config/example.database.yml $workdir/config/database.yml
RUN touch $workdir/config/settings.local.yml
Expand Down Expand Up @@ -78,9 +116,9 @@ RUN apt-get update && apt-get install -y libapache2-mod-passenger
RUN echo "ServerName $(cat /etc/hostname)" >> /etc/apache2/apache2.conf
RUN a2enmod passenger

# Check installation
RUN /usr/bin/passenger-config validate-install
RUN /usr/sbin/passenger-memory-stats
# # Check installation
# RUN /usr/bin/passenger-config validate-install
# RUN /usr/sbin/passenger-memory-stats

# Enable required apache modules for the cgimap Apache service
RUN a2enmod proxy proxy_http rewrite
Expand All @@ -104,3 +142,5 @@ COPY start.sh $workdir/
COPY liveness.sh $workdir/

CMD $workdir/start.sh


0 comments on commit fb6f57e

Please sign in to comment.