[PATCH 2 of 3] Drop using explicit container names

Wald Commits scm-commit at wald.intevation.org
Thu Jul 20 10:36:38 CEST 2023


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1689841559 -7200
#      Thu Jul 20 10:25:59 2023 +0200
# Branch 3.2.x
# Node ID 75dc4ea60938afc462657c0c63f4046c36ef4758
# Parent  a1399209b0d62f5fe67d509fee5b2f76199f8ec0
Drop using explicit container names

Compose will generate names for the containers and containers can connect
each other on the network via the service names. This avoids the
unnecessary extra "name space" and prepares the application for usage
with different project names.

diff -r a1399209b0d6 -r 75dc4ea60938 artifacts/doc/conf/backend-db.xml
--- a/artifacts/doc/conf/backend-db.xml	Thu Jul 20 10:03:06 2023 +0200
+++ b/artifacts/doc/conf/backend-db.xml	Thu Jul 20 10:25:59 2023 +0200
@@ -5,7 +5,7 @@
     <password>d4e</password>
     <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
     <driver>org.postgresql.Driver</driver>
-    <url>jdbc:postgresql://d4eriver-db:5432/</url>
+    <url>jdbc:postgresql://db:5432/</url>
     <validation-query>select 1 from rivers</validation-query>
     <max-wait>30000</max-wait>
 </backend-database>
diff -r a1399209b0d6 -r 75dc4ea60938 artifacts/doc/conf/seddb-db.xml
--- a/artifacts/doc/conf/seddb-db.xml	Thu Jul 20 10:03:06 2023 +0200
+++ b/artifacts/doc/conf/seddb-db.xml	Thu Jul 20 10:25:59 2023 +0200
@@ -5,7 +5,7 @@
     <password>seddb</password>
     <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
     <driver>org.postgresql.Driver</driver>
-    <url>jdbc:postgresql://d4eriver-db:5432/seddb</url>
+    <url>jdbc:postgresql://db:5432/seddb</url>
     <validation-query>select 1 from gewaesser</validation-query>
     <max-wait>30000</max-wait>
     <!--
diff -r a1399209b0d6 -r 75dc4ea60938 docker/docker-compose.yml
--- a/docker/docker-compose.yml	Thu Jul 20 10:03:06 2023 +0200
+++ b/docker/docker-compose.yml	Thu Jul 20 10:25:59 2023 +0200
@@ -1,13 +1,11 @@
 version: "3.5"
 services:
   db:
-    container_name: "d4eriver-db"
     build:
       context: ../
       dockerfile: ./docker/Dockerfile.db
     image: "d4e/river_db"
-  server:
-    container_name: "d4eriver-artifacts"
+  artifacts:
     build:
       context: ../
       dockerfile: ./docker/Dockerfile.artifacts
@@ -24,31 +22,28 @@
     # ports:
     #   - 8787:8787
   mapserv:
-    container_name: "d4eriver-mapserv"
     build:
       context: ./
       dockerfile: ./Dockerfile.mapserv
     image: "d4e/river_mapserv"
     depends_on:
       - db
-      - server
+      - artifacts
     volumes:
       - ./mapserver/cgi-bin:/var/www/cgi-bin
       - ../artifacts/doc/conf/mapserver:/opt/d4e/bin/conf/mapserver
       - artifacts-data:/opt/d4e/bin/artifacts-data
   client:
-    container_name: "d4eriver-client"
     build:
       context: ../
       dockerfile: ./docker/Dockerfile.gwt-client
     image: "d4e/river_client"
     depends_on:
-      - server
+      - artifacts
       - mapserv
     volumes:
       - ../gwt-client/config:/opt/d4e/river/gwt-client/config
   wiki:
-    container_name: "d4eriver-wiki"
     build:
       context: ./
       dockerfile: ./Dockerfile.wiki
diff -r a1399209b0d6 -r 75dc4ea60938 docker/httpd-wiki.conf
--- a/docker/httpd-wiki.conf	Thu Jul 20 10:03:06 2023 +0200
+++ b/docker/httpd-wiki.conf	Thu Jul 20 10:25:59 2023 +0200
@@ -3,12 +3,12 @@
 
 # GWT client
 RedirectMatch "^/$" "/d4e-river"
-ProxyPass "/d4e-river" "ajp://d4eriver-client:8009/d4e-river"
-ProxyPassReverse "/d4e-river" "ajp://d4eriver-client:8009/d4e-river"
+ProxyPass "/d4e-river" "ajp://client:8009/d4e-river"
+ProxyPassReverse "/d4e-river" "ajp://client:8009/d4e-river"
 
 # MapServer
-ProxyPass "/cgi-bin" "http://d4eriver-mapserv/cgi-bin"
-ProxyPassReverse "/cgi-bin" "http://d4eriver-mapserv/cgi-bin"
+ProxyPass "/cgi-bin" "http://mapserv/cgi-bin"
+ProxyPassReverse "/cgi-bin" "http://mapserv/cgi-bin"
 
 # Wiki
 WSGIScriptAlias /wiki /opt/wiki/moin-1.9.9/wiki/server/moin.wsgi
diff -r a1399209b0d6 -r 75dc4ea60938 gwt-client/src/main/webapp/WEB-INF/web.xml
--- a/gwt-client/src/main/webapp/WEB-INF/web.xml	Thu Jul 20 10:03:06 2023 +0200
+++ b/gwt-client/src/main/webapp/WEB-INF/web.xml	Thu Jul 20 10:25:59 2023 +0200
@@ -14,7 +14,7 @@
 
     <context-param>
         <param-name>server-url</param-name>
-        <param-value>http://d4eriver-artifacts:8181</param-value>
+        <param-value>http://artifacts:8181</param-value>
     </context-param>
 
     <context-param>


More information about the Dive4Elements-commits mailing list