Browse Source

feat(docker): migrate to Compose file version 2

- introduce back and front networks
- IPv6 broken for now, fix later
Peter Thomassen 8 years ago
parent
commit
6c3ced1096
4 changed files with 79 additions and 48 deletions
  1. 17 15
      docker-compose.dev.yml
  2. 60 30
      docker-compose.yml
  3. 2 2
      nslord/conf/pdns.conf
  4. 0 1
      nslord/conf/pdns.d/pdns.local.gmysql.conf

+ 17 - 15
docker-compose.dev.yml

@@ -1,16 +1,18 @@
-nslord:
-  # extending from main .yml
-  ports:
-    - "5300:53"
-    - "5300:53/udp"
-    - "8081:8081"
+version: '2'
 
 
-devadmin:
-  build: devadmin
-  links:
-   - db
-  ports:
-   - "81:80"
-  volumes:
-   - ./devadmin/html:/var/www/html
-   - ./devadmin/config.inc.php:/var/www/html/poweradmin/inc/config.inc.php
+services:
+  nslord:
+    # extending from main .yml
+    ports:
+     - "5300:53"
+     - "5300:53/udp"
+
+  devadmin:
+    build: devadmin
+    ports:
+     - "81:80"
+    volumes:
+     - ./devadmin/html:/var/www/html
+     - ./devadmin/config.inc.php:/var/www/html/poweradmin/inc/config.inc.php
+    networks:
+    - back

+ 60 - 30
docker-compose.yml

@@ -1,34 +1,64 @@
-www:
-  build: desec-www
-  ports:
-   - "80:80"
-   - "443:443"
-  volumes:
-   - ./desec-certs/dev.desec.io:/etc/ssl/private
-  links:
-   - static
-   - api
-  mac_address: 06:42:ac:11:00:01
+version: '2'
 
 
-static:
-  build: desec-static
+services:
+  www:
+    build: desec-www
+    ports:
+    - "80:80"
+    - "443:443"
+    volumes:
+    - ./desec-certs/dev.desec.io:/etc/ssl/private
+    depends_on:
+    - static
+    - api
+    mac_address: 06:42:ac:11:00:01
+    networks:
+    - front
 
 
-db:
-  build: db
-  environment:
-   - MYSQL_ROOT_PASSWORD=test123
+  static:
+    build: desec-static
+    networks:
+    - front
 
 
-api:
-  build: api
-  links:
-   - db
-   - nslord
-  volumes:
-   - ./api-settings.py:/usr/src/app/desecapi/settings_local.py
+  db:
+    build: db
+    environment:
+    - MYSQL_ROOT_PASSWORD=test123
+    networks:
+    - back
 
 
-nslord:
-  build: nslord
-  volumes:
-   - ./nslord/conf:/etc/powerdns
-  links:
-   - db
+  api:
+    build: api
+    depends_on:
+    - db
+    - nslord
+    volumes:
+    - ./api-settings.py:/usr/src/app/desecapi/settings_local.py
+    networks:
+    - back
+    - front
+
+  nslord:
+    build: nslord
+    volumes:
+    - ./nslord/conf:/etc/powerdns
+    depends_on:
+    - db
+    networks:
+    - back
+
+networks:
+  back:
+    driver: bridge
+    ipam:
+      driver: default
+      config:
+      - subnet: 172.16.0.0/24
+        gateway: 172.16.0.1
+  front:
+    driver: bridge
+    ipam:
+      driver: default
+      config:
+      - subnet: 172.16.1.0/24
+        gateway: 172.16.1.1

+ 2 - 2
nslord/conf/pdns.conf

@@ -1,4 +1,4 @@
-allow-axfr-ips=172.17.0.1/16
+allow-axfr-ips=172.16.0.0/24
 #also-notify=172.17.0.1
 #also-notify=172.17.0.1
 api=yes
 api=yes
 api-key=123password
 api-key=123password
@@ -15,4 +15,4 @@ setuid=pdns
 soa-minimum-ttl=60
 soa-minimum-ttl=60
 webserver=yes
 webserver=yes
 webserver-address=0.0.0.0
 webserver-address=0.0.0.0
-webserver-allow-from=172.17.0.1/16
+webserver-allow-from=172.16.0.0/24

+ 0 - 1
nslord/conf/pdns.d/pdns.local.gmysql.conf

@@ -6,4 +6,3 @@ gmysql-dbname=pdnslord
 gmysql-user=pdnslord
 gmysql-user=pdnslord
 gmysql-password=123test
 gmysql-password=123test
 gmysql-dnssec=yes
 gmysql-dnssec=yes
-