1
- FROM phusion/passenger-ruby33
1
+ FROM ruby:3.3.0
2
2
ENV DEBIAN_FRONTEND=noninteractive
3
3
ENV workdir /var/www
4
+
5
+ # Production OSM setup
4
6
ENV RAILS_ENV=production
5
7
6
8
# Install the openstreetmap-website dependencies
@@ -22,20 +24,6 @@ RUN apt-get update && apt-get install -y nodejs yarn && \
22
24
apt-get clean && \
23
25
rm -rf /var/lib/apt/lists/*
24
26
25
- # # Install Passenger + Apache module
26
- # RUN apt-get update && apt-get install -y \
27
- # cmake \
28
- # libgcrypt20 \
29
- # openssl \
30
- # rubygems \
31
- # s3cmd && \
32
- # apt-get clean && \
33
- # rm -rf /var/lib/apt/lists/*
34
- # RUN gem install passenger
35
- # RUN passenger-install-apache2-module
36
-
37
- # RUN apt-get install -y libapache2-mod-passenger lighttpd
38
-
39
27
# Install openstreetmap-cgimap requirements
40
28
RUN apt-get update && apt-get -y install libpqxx-dev libfcgi-dev zlib1g-dev \
41
29
libboost-dev libboost-program-options-dev libfmt-dev \
@@ -44,16 +32,19 @@ RUN apt-get update && apt-get -y install libpqxx-dev libfcgi-dev zlib1g-dev \
44
32
apt-get clean && \
45
33
rm -rf /var/lib/apt/lists/*
46
34
47
- # Install cgimap
48
- ENV cgimap /tmp/openstreetmap-cgimap
49
- ENV CGIMAP_GITSHA=5cd3d21bebe9d205828608be4c65bbda8b464308
50
- RUN git clone -b master https://github.com/zerebubuth/openstreetmap-cgimap.git $cgimap
51
- RUN cd $cgimap && git checkout $CGIMAP_GITSHA
52
- RUN cd $cgimap && \
53
- ./autogen.sh && \
54
- ./configure && \
55
- make && \
56
- make install
35
+ # # Install cgimap
36
+ # ENV cgimap /tmp/openstreetmap-cgimap
37
+ # ENV CGIMAP_GITSHA=5cd3d21bebe9d205828608be4c65bbda8b464308
38
+ # RUN git clone -b master https://github.com/zerebubuth/openstreetmap-cgimap.git $cgimap
39
+ # RUN cd $cgimap && git checkout $CGIMAP_GITSHA
40
+ # RUN cd $cgimap && \
41
+ # ./autogen.sh && \
42
+ # ./configure && \
43
+ # make && \
44
+ # make install
45
+
46
+ # Install Passenger
47
+ RUN gem install passenger
57
48
58
49
# Install svgo required
59
50
RUN npm install -g svgo
@@ -97,23 +88,30 @@ RUN a2enmod setenvif
97
88
RUN a2dissite 000-default
98
89
RUN a2ensite production
99
90
100
- # Enable the Passenger Apache module and restart Apache
91
+ # # Enable the Passenger Apache module and restart Apache
101
92
RUN echo "ServerName $(cat /etc/hostname)" >> /etc/apache2/apache2.conf
102
93
103
- # # Install Passenger + Apache module
104
- RUN passenger-install-apache2-module
94
+ # Install Passenger
95
+ RUN gem install passenger && passenger-install-apache2-module --auto
96
+
97
+ # Config passenger module
98
+ RUN echo "LoadModule passenger_module $(passenger-config --root)/buildout/apache2/mod_passenger.so" > /etc/apache2/mods-available/passenger.load
99
+ RUN echo "<IfModule mod_passenger.c>\n \
100
+ PassengerRoot $(passenger-config --root)\n \
101
+ PassengerRuby /usr/bin/ruby\n \
102
+ </IfModule>" > /etc/apache2/mods-available/passenger.conf
105
103
106
- # RUN a2enmod passenger
104
+ RUN a2enmod passenger
107
105
108
- # Check installation
109
- RUN /usr/bin/passenger-config validate-install
110
- RUN /usr/sbin /passenger-memory-stats
106
+ # # Check installation
107
+ RUN /usr/local/bundle/ bin/passenger-config validate-install
108
+ RUN /usr/local/bundle/bin /passenger-memory-stats
111
109
112
- # Enable required apache modules for the cgimap Apache service
110
+ # # Enable required apache modules for the cgimap Apache service
113
111
RUN a2enmod proxy proxy_http rewrite lbmethod_byrequests proxy_fcgi
114
112
115
113
# Config the virtual host apache2
116
- # RUN apache2ctl configtest
114
+ RUN apache2ctl configtest
117
115
118
116
# Set Permissions for www-data
119
117
RUN chown -R www-data: $workdir
0 commit comments