Skip to content

Commit

Permalink
configure postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
helvalius committed Apr 30, 2015
1 parent a0d2bfe commit cf8dc34
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:14.04
MAINTAINER [email protected]

RUN apt-get update

Expand Down Expand Up @@ -60,7 +61,8 @@ RUN service postgresql start && \
RUN service postgresql start && \
sudo -u postgres psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='nominatim'" | grep -q 1 || sudo -u postgres createuser -s nominatim && \
sudo -u postgres psql postgres -tAc "SELECT 1 FROM pg_roles WHERE rolname='www-data'" | grep -q 1 || sudo -u postgres createuser -SDR www-data && \
sudo -u postgres psql postgres -c "DROP DATABASE IF EXISTS nominatim"
sudo -u postgres psql postgres -c "DROP DATABASE IF EXISTS nominatim" && \
sudo -u postgres psql -c "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';"

RUN wget --output-document=/app/data.pbf http://download.geofabrik.de/europe/monaco-latest.osm.pbf
# RUN wget --output-document=/app/data.pbf http://download.geofabrik.de/europe/luxembourg-latest.osm.pbf
Expand All @@ -84,16 +86,29 @@ RUN ls settings/
RUN cat settings/local.php
RUN ./utils/setup.php --create-website /var/www/nominatim



# Adjust PostgreSQL configuration so that remote connections to the
# database are possible.
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf

# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf

# Expose the PostgreSQL port
EXPOSE 5432

RUN apt-get install -y curl
ADD 400-nominatim.conf /etc/apache2/sites-available/400-nominatim.conf
ADD httpd.conf /etc/apache2/
RUN service apache2 start && \
a2ensite 400-nominatim.conf && \
/etc/init.d/apache2 reload


# Expose the HTTP port
EXPOSE 8080


ADD configPostgresql.sh /app/nominatim/configPostgresql.sh
WORKDIR /app/nominatim
RUN chmod +x ./configPostgresql.sh
Expand Down

0 comments on commit cf8dc34

Please sign in to comment.