Skip to content

Commit

Permalink
Merge pull request #279 from Telecominfraproject/WIFI-13969-docker-co…
Browse files Browse the repository at this point in the history
…mpose-default-to-postgres

Wifi 13969 docker compose default to postgres
  • Loading branch information
carsten989 authored Jul 29, 2024
2 parents 4fcbd32 + dceb24d commit 3e8795a
Show file tree
Hide file tree
Showing 14 changed files with 279 additions and 187 deletions.
8 changes: 6 additions & 2 deletions docker-compose/.env.letsencrypt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Image tags
COMPOSE_PROJECT_NAME=openwifi

# Image tags
OWGW_TAG=master
OWGWUI_TAG=main
OWSEC_TAG=main
Expand All @@ -8,10 +9,12 @@ OWPROV_TAG=main
OWPROVUI_TAG=main
OWANALYTICS_TAG=main
OWSUB_TAG=main

KAFKA_TAG=2.8.0-debian-10-r43
ZOOKEEPER_TAG=3.8
POSTGRESQL_TAG=15.0
ACMESH_TAG=latest
TRAEFIK_TAG=latest
TRAEFIK_TAG=v3.1.0

# Microservice root/config directories
OWGW_ROOT=/owgw-data
Expand All @@ -38,3 +41,4 @@ INTERNAL_OWANALYTICS_HOSTNAME=owanalytics.wlan.local
INTERNAL_RTTYS_HOSTNAME=rttys.wlan.local
INTERNAL_OWSUB_HOSTNAME=owsub.wlan.local
SDKHOSTNAME=
#SDKHOSTNAME=openwifi.example.com
5 changes: 4 additions & 1 deletion docker-compose/.env.selfsigned
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Image tags
COMPOSE_PROJECT_NAME=openwifi

# Image tags
OWGW_TAG=master
OWGWUI_TAG=main
OWSEC_TAG=main
Expand All @@ -8,8 +9,10 @@ OWPROV_TAG=main
OWPROVUI_TAG=main
OWANALYTICS_TAG=main
OWSUB_TAG=main

KAFKA_TAG=2.8.0-debian-10-r43
ZOOKEEPER_TAG=3.8
POSTGRESQL_TAG=15.0
ACMESH_TAG=latest
TRAEFIK_TAG=latest

Expand Down
165 changes: 96 additions & 69 deletions docker-compose/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ Resources:
docker-compose.lb.letsencrypt.yml --env-file .env.letsencrypt"
alias docker-compose-lb-selfsigned="docker-compose -f \
docker-compose.lb.selfsigned.yml --env-file .env.selfsigned"
alias docker-compose-postgresql="docker-compose -f \
docker-compose.yml -f docker-compose.postgresql.yml"
mode: "000644"
owner: "root"
group: "root"
Expand Down
43 changes: 43 additions & 0 deletions docker-compose/docker-compose.lb.letsencrypt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ volumes:
driver: local
kafka_data:
driver: local
postgresql_data:
driver: local
letsencrypt_certs:
driver: local

Expand All @@ -36,6 +38,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owgw"]
restart: unless-stopped
volumes:
- owgw_data:${OWGW_ROOT}/persist
Expand Down Expand Up @@ -72,6 +77,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owsec"]
restart: unless-stopped
volumes:
- owsec_data:${OWSEC_ROOT}/persist
Expand All @@ -89,6 +97,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owfms"]
restart: unless-stopped
volumes:
- owfms_data:${OWFMS_ROOT}/persist
Expand All @@ -106,6 +117,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owprov"]
restart: unless-stopped
volumes:
- owprov_data:${OWPROV_ROOT}
Expand Down Expand Up @@ -138,6 +152,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owanalytics"]
restart: unless-stopped
volumes:
- owanalytics_data:${OWANALYTICS_ROOT}
Expand All @@ -155,6 +172,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owsub"]
restart: unless-stopped
volumes:
- owsub_data:${OWSUB_ROOT}
Expand Down Expand Up @@ -247,3 +267,26 @@ services:
- "1812:1812/udp"
- "1813:1813/udp"
- "3799:3799/udp"

postgresql:
image: "postgres:${POSTGRESQL_TAG}"
networks:
openwifi:
command:
- "postgres"
- "-c"
- "max_connections=400"
- "-c"
- "shared_buffers=20MB"
env_file:
- postgresql.env
restart: unless-stopped
volumes:
- postgresql_data:/var/lib/postgresql/data
- ./postgresql/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d owsub"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
45 changes: 43 additions & 2 deletions docker-compose/docker-compose.lb.selfsigned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ volumes:
driver: local
kafka_data:
driver: local
postgresql_data:
driver: local

networks:
openwifi:
Expand All @@ -34,6 +36,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owgw"]
restart: unless-stopped
volumes:
- owgw_data:${OWGW_ROOT}/persist
Expand All @@ -45,8 +50,6 @@ services:

owgw-ui:
image: "tip-tip-wlan-cloud-ucentral.jfrog.io/owgw-ui:${OWGWUI_TAG}"
env_file:
- owgw-ui.env
networks:
openwifi:
aliases:
Expand All @@ -72,6 +75,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owsec"]
restart: unless-stopped
volumes:
- owsec_data:${OWSEC_ROOT}/persist
Expand All @@ -89,6 +95,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owfms"]
restart: unless-stopped
volumes:
- owfms_data:${OWFMS_ROOT}/persist
Expand All @@ -106,6 +115,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owprov"]
restart: unless-stopped
volumes:
- owprov_data:${OWPROV_ROOT}
Expand Down Expand Up @@ -138,6 +150,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owanalytics"]
restart: unless-stopped
volumes:
- owanalytics_data:${OWANALYTICS_ROOT}
Expand All @@ -155,6 +170,9 @@ services:
depends_on:
init-kafka:
condition: service_completed_successfully
postgresql:
condition: service_healthy
command: ["./wait-for-postgres.sh", "postgresql", "/openwifi/owsub"]
restart: unless-stopped
volumes:
- owsub_data:${OWSUB_ROOT}
Expand Down Expand Up @@ -241,3 +259,26 @@ services:
- "1812:1812/udp"
- "1813:1813/udp"
- "3799:3799/udp"

postgresql:
image: "postgres:${POSTGRESQL_TAG}"
networks:
openwifi:
command:
- "postgres"
- "-c"
- "max_connections=400"
- "-c"
- "shared_buffers=20MB"
env_file:
- postgresql.env
restart: unless-stopped
volumes:
- postgresql_data:/var/lib/postgresql/data
- ./postgresql/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d owsub"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
75 changes: 0 additions & 75 deletions docker-compose/docker-compose.postgresql.yml

This file was deleted.

Loading

0 comments on commit 3e8795a

Please sign in to comment.