{"id":16709367,"url":"https://github.com/mrlesmithjr/docker-phpipam","last_synced_at":"2025-04-10T05:34:06.677Z","repository":{"id":142637279,"uuid":"63359386","full_name":"mrlesmithjr/docker-phpipam","owner":"mrlesmithjr","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-24T02:43:16.000Z","size":12,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T06:51:46.597Z","etag":null,"topics":["docker","phpipam"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrlesmithjr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-14T18:17:19.000Z","updated_at":"2023-08-17T13:33:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a8f7702-eb1e-4da4-9ca5-2bbc7c54a4c7","html_url":"https://github.com/mrlesmithjr/docker-phpipam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fdocker-phpipam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fdocker-phpipam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fdocker-phpipam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fdocker-phpipam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrlesmithjr","download_url":"https://codeload.github.com/mrlesmithjr/docker-phpipam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248163297,"owners_count":21057905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","phpipam"],"created_at":"2024-10-12T20:04:40.730Z","updated_at":"2025-04-10T05:34:06.652Z","avatar_url":"https://github.com/mrlesmithjr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"docker-phpipam\n--------------\n\nBuilds [Docker] image to run [phpIPAM] container with persistent data.  \n\nRequirements\n------------\n\nA working [Docker] setup.  \n\n## How-To\nSpin up [phpIPAM] environment using the included `docker-compose.yml`.  \n\n```\nversion: '2'\nservices:\n  db:\n    image: mrlesmithjr/mysql:latest\n    volumes:\n      - \"db:/var/lib/mysql\"\n    restart: always\n    environment:\n      MYSQL_ROOT_PASSWORD: phpipam\n      MYSQL_DATABASE: phpipam\n      MYSQL_USER: phpipam\n      MYSQL_PASSWORD: phpipam\n\n  web:\n    depends_on:\n      - db\n    image: mrlesmithjr/docker-phpipam:latest\n    links:\n      - db\n    ports:\n      - \"8000:80\"\n    restart: always\n    environment:\n      MYSQL_DB_HOSTNAME: db\n      MYSQL_DB_USERNAME: phpipam\n      MYSQL_DB_PASSWORD: phpipam\n      MYSQL_DB_NAME: phpipam\n      MYSQL_DB_PORT: 3306\n\nvolumes:\n  db:\n```\n\nSpin up the environment with `docker-compose up -d`\n\nOnce complete if you run `docker ps` you should see similar to below:\n\n```\nCONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                           NAMES\n2446630340d9        mrlesmithjr/docker-phpipam:latest   \"apache2ctl -D FOREGR\"   43 minutes ago      Up 43 minutes       443/tcp, 0.0.0.0:8000-\u003e80/tcp   dockerphpipam_web_1\n1082d5b687b0        mrlesmithjr/mysql:latest            \"docker-entrypoint.sh\"   3 hours ago         Up 43 minutes       3306/tcp                        dockerphpipam_db_1\n```\nOne thing that is left which still needs work is the [phpIPAM] DB schema but we\ncan handle that with the below:\n```\ndocker exec -it dockerphpipam_web_1 bash -c \"mysql -u phpipam -p -h db phpipam \u003c /var/www/html/db/SCHEMA.sql\"\n```\nWhen prompted for password enter `phpipam` and the DB will be populated.  \nNow open up your browser of choice and connect to http://127.0.0.1:8000 and\nlogin with `admin/ipamadmin`. And you will be prompted to change the default\npassword.\n\nAnd you are now good to go to begin using [phpIPAM].\n\nNotes\n-----\nI was not able to get cron jobs to run as desired\nhowever you can execute the following manually for example or schedule them to run from your [Docker] host.\n\n`Discover hosts`\n```\ndocker exec -it dockerphpipam_web_1 /usr/bin/php /var/www/html/functions/scripts/discoveryCheck.php\n```\n`Resolve IP addresses`\n```\ndocker exec -it dockerphpipam_web_1 /usr/bin/php /var/www/html/functions/scripts/resolveIPaddresses.php\n```\n`Ping check`\n```\ndocker exec -it dockerphpipam_web_1 /usr/bin/php /var/www/html/functions/scripts/pingCheck.php\n```\nIf you spin this up using `docker-compose` then you will have a persistent data\nvolume that gets created to ensure that your data remains. The data volume is\ncreated as a name so it is easier to find and will always be mapped to the same\nvolume. By default this will be named as the project name_db. So for example:\n`dockerphpipam_db`.\nYou can view/inspect this volume by:\n```\ndocker volume inspect dockerphpipam_db\n```\n```\n[\n    {\n        \"Name\": \"dockerphpipam_db\",\n        \"Driver\": \"local\",\n        \"Mountpoint\": \"/var/lib/docker/volumes/dockerphpipam_db/_data\",\n        \"Labels\": null,\n        \"Scope\": \"local\"\n    }\n]\n```\nAnd if you were to have spun this up previously when the data volume was `./.data`\nthen you can easily migrate your existing data by doing the following (using above\nexample) in the project folder:\n```\nsudo su\nsudo cp -r ./.data/db/. /var/lib/docker/volumes/dockerphpipam_db/_data\n```\n\nBacking up DB data\n------------------\nIf you find yourself in need of backing up your DB data in order to migrate to\nanother host or just to backup the data in general. You can do that as simple as\nbelow:\n* Requirements\n  * Destination mountpoint to backup to `/backups`\n\nWe will use the method of backing up using the `--volumes-from` [Docker] volume\noption. This process will spin up a temporary container, mount the\n`/var/lib/mysql` folder, and then back it all up to a `tar.gz` file in our\n`/backups` folder.\n```\ndocker run --rm --volumes-from dockerphpipam_db_1 \\\n-v /backups:/backup ubuntu tar cvzf /backup/dockerphpipam_db_1.backup.tar.gz \\\n/var/lib/mysql\n```\nAnd to validate that the backup exists:\n```\nll /backups\ntotal 550\ndrwxrwxrwx  2 root root      3 Aug 11 01:01 ./\ndrwxr-xr-x 24 root root   4096 Aug 11 00:47 ../\n-rw-r--r--  1 root root 811475 Aug 11 01:01 dockerphpipam_db_1.backup.tar.gz\n```\nNow you can copy/move that anywhere and extract it with all of your data intact.\n\n[phpIPAM]: \u003chttp://phpipam.net\u003e\n[Docker]: \u003chttp://docker.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlesmithjr%2Fdocker-phpipam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrlesmithjr%2Fdocker-phpipam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlesmithjr%2Fdocker-phpipam/lists"}