diff --git a/Dockerfile b/Dockerfile index 7cea824..cc8f185 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,11 +39,11 @@ WORKDIR /opt/phpipam-agent RUN cp config.dist.php config.php && \ sed -i -e "s/\['key'\] = .*;/\['key'\] = getenv(\"PHPIPAM_AGENT_KEY\");/" \ -e "s/\['pingpath'\] = .*;/\['pingpath'\] = \"\/usr\/sbin\/fping\";/" \ - -e "s/\['db'\]\['host'\] = \"localhost\"/\['db'\]\['host'\] = getenv(\"MYSQL_ENV_MYSQL_HOST\")/" \ - -e "s/\['db'\]\['user'\] = \"phpipam\"/\['db'\]\['user'\] = getenv(\"MYSQL_ENV_MYSQL_USER\")/" \ - -e "s/\['db'\]\['pass'\] = \"phpipamadmin\"/\['db'\]\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_PASSWORD\")/" \ - -e "s/\['db'\]\['name'\] = \"phpipam\"/\['db'\]\['name'\] = getenv(\"MYSQL_ENV_MYSQL_DATABASE\")/" \ - -e "s/\['db'\]\['port'\] = 3306/\['db'\]\['port'\] = getenv(\"MYSQL_ENV_MYSQL_PORT\")/" \ + -e "s/\['db'\]\['host'\] = \"localhost\"/\['db'\]\['host'\] = getenv(\"PHPIPAM_DB_HOST\")/" \ + -e "s/\['db'\]\['user'\] = \"phpipam\"/\['db'\]\['user'\] = getenv(\"PHPIPAM_DB_USER\")/" \ + -e "s/\['db'\]\['pass'\] = \"phpipamadmin\"/\['db'\]\['pass'\] = getenv(\"PHPIPAM_DB_PASS\")/" \ + -e "s/\['db'\]\['name'\] = \"phpipam\"/\['db'\]\['name'\] = getenv(\"PHPIPAM_DB_NAME\")/" \ + -e "s/\['db'\]\['port'\] = 3306/\['db'\]\['port'\] = getenv(\"PHPIPAM_DB_PORT\")/" \ config.php \ \ && chmod +x /entrypoint.sh \ diff --git a/entrypoint.sh b/entrypoint.sh index c398ba8..8a46670 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -case "$SCAN_INTERVAL" in +case "$PHPIPAM_SCAN_INTERVAL" in 5m) CRON_S="*/5 *" ;; 10m) CRON_S="*/10 *" diff --git a/example-docker-compose.yml b/example-docker-compose.yml index 7092fc1..8fdae83 100644 --- a/example-docker-compose.yml +++ b/example-docker-compose.yml @@ -5,11 +5,11 @@ services: restart: unless-stopped image: jbowdre/phpipam-agent:latest environment: - - MYSQL_ENV_MYSQL_HOST=ipamhost - - MYSQL_ENV_MYSQL_DATABASE=phpipam - - MYSQL_ENV_MYSQL_USER=phpipam - - MYSQL_ENV_MYSQL_PASSWORD=phpipamadmin - - MYSQL_ENV_MySQL_PORT=3306 + - PHPIPAM_DB_HOST=ipamhost + - PHPIPAM_DB_NAME=phpipam + - PHPIPAM_DB_USER=phpipam + - PHPIPAM_DB_PASS=phpipamadmin + - PHPIPAM_DB_PORT=3306 - PHPIPAM_AGENT_KEY=2RuQ0rt4Rir29vGN4_1ZOqShcUX7PSUb - - SCAN_INTERVAL=15m + - PHPIPAM_SCAN_INTERVAL=15m - TZ=UTC