{"id":24390432,"url":"https://github.com/pgedge/pgedge-docker","last_synced_at":"2025-04-11T09:15:31.388Z","repository":{"id":218761138,"uuid":"740657481","full_name":"pgEdge/pgedge-docker","owner":"pgEdge","description":"Dockerfile and Docker examples for pgEdge","archived":false,"fork":false,"pushed_at":"2025-04-07T22:22:38.000Z","size":66,"stargazers_count":9,"open_issues_count":5,"forks_count":3,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-07T22:32:26.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hub.docker.com/repository/docker/pgedge/pgedge","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgEdge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-01-08T19:48:53.000Z","updated_at":"2025-04-03T19:21:35.000Z","dependencies_parsed_at":"2025-03-07T14:32:27.264Z","dependency_job_id":"2718bbf5-a55d-453d-8ef4-1d31f627c797","html_url":"https://github.com/pgEdge/pgedge-docker","commit_stats":null,"previous_names":["pgedge/pgedge-docker"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgEdge%2Fpgedge-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgEdge%2Fpgedge-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgEdge%2Fpgedge-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgEdge%2Fpgedge-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgEdge","download_url":"https://codeload.github.com/pgEdge/pgedge-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248366130,"owners_count":21091911,"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":[],"created_at":"2025-01-19T16:17:34.232Z","updated_at":"2025-04-11T09:15:31.355Z","avatar_url":"https://github.com/pgEdge.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgEdge Docker\n\nThis repository contains the Dockerfile used to build\n[pgedge/pgedge](https://hub.docker.com/repository/docker/pgedge/pgedge)\non Docker Hub.\n\nSee the example commands below for running pgEdge containers in Docker. You will\nneed to provide a JSON configuration file that specifies the database nodes and\nusers.\n\n## Examples\n\n### Single Node\n\nTo run a single node you can use this command:\n\n```\ndocker run -it --rm -p 5432:5432 \\\n  -v \"./examples/singlenode/db.json:/home/pgedge/db.json\" \\\n  pgedge/pgedge\n```\n\nYou can then log in using `psql` with the following command:\n\n```\nPGPASSWORD=uFR44yr69C4mZa72g3JQ37GX \\\npsql -h localhost -p 5432 -U admin defaultdb\n```\n\nAnd of course you should customize the user passwords before using this in\nany real deployment.\n\n### Multi-Node\n\nA Docker Swarm example of a two node cluster is located at [examples/swarm](examples/swarm).\n\n## Data Volumes\n\nThis image is compatible with Docker volumes and bind mounts. The configuration\nfor both is similar. Because PostgreSQL requires the data directory to be owned\nby the user running the database, the `PGDATA` directory should be specified as\na subdirectory of the volume mount.\n\nBy default, this image uses the following approach for volume configuration:\n\n- `/data` is the volume mount point\n- `/data/pgdata` is the PostgreSQL data directory (`PGDATA`)\n\nAn example Docker compose spec that bind mounts the host folder `./n1` to the\ncontainer's `/data` folder looks like this:\n\n```yaml\npostgres-n1:\n  image: pgedge/pgedge:latest\n  environment:\n    - 'NODE_NAME=n1'\n    - 'PGDATA=/data/pgdata'\n  volumes:\n    - './db.json:/home/pgedge/db.json'\n    - './n1:/data'\n```\n\nYou can also take a look at [examples/swarm/stack.yaml](examples/swarm/stack.yaml)\nfor an example of using Docker volumes.\n\n## Automatic DDL Replication\n\nAutomatically replicating DDL statements is available on an opt-in basis. To\nenable this behavior, set the `autoddl:enabled` option on the database. Currently\nthis option must be set at the time of database creation. Changing the option\nafter creation is possible, but is not yet documented here.\n\n```json\n{\n  \"options\": [\"autoddl:enabled\"]\n}\n```\n\nSee the full example JSON configuration in the\n[Database Configuration](#database-configuration) section below.\n\nThe user running DDL statements must be a superuser currently in order to use\nautomatic DDL replication.\n\nMore information on automatic DDL replication can be found [here](https://docs.pgedge.com/platform/advanced/autoddl).\n\n## Database Configuration\n\nA simple JSON file is used to configure the database nodes. You can customize\nthis according to your needs, including adding more nodes and users. Always\nremember to change the passwords!\n\n```json\n{\n  \"name\": \"defaultdb\",\n  \"port\": 5432,\n  \"options\": [\"autoddl:enabled\"],\n  \"nodes\": [\n    {\n      \"name\": \"n1\",\n      \"region\": \"us-east-1\",\n      \"hostname\": \"postgres-n1\"\n    },\n    {\n      \"name\": \"n2\",\n      \"region\": \"us-east-2\",\n      \"hostname\": \"postgres-n2\"\n    }\n  ],\n  \"users\": [\n    {\n      \"username\": \"admin\",\n      \"password\": \"uFR44yr69C4mZa72g3JQ37GX\",\n      \"superuser\": true,\n      \"service\": \"postgres\",\n      \"type\": \"admin\"\n    },\n    {\n      \"username\": \"pgedge\",\n      \"password\": \"z1Zsku10a91RS526jnVrLC39\",\n      \"superuser\": true,\n      \"service\": \"postgres\",\n      \"type\": \"internal_admin\"\n    },\n    {\n      \"username\": \"pgcat_auth\",\n      \"password\": \"5Y306TW24540dEnyxp3mQBwH\",\n      \"service\": \"postgres\",\n      \"type\": \"pooler_auth\"\n    },\n    {\n      \"username\": \"pgcat_admin\",\n      \"password\": \"k6uu4od8r0P6lA11Oep648KC\",\n      \"service\": \"pgcat\",\n      \"type\": \"other\"\n    }\n  ]\n}\n```\n\n## Spock Notes\n\nWhen the container runs, the [Spock](https://github.com/pgedge/spock) extension\nis created and replication subscriptions are _automatically created_.\n\nIf you do not use automatic DDL replication as described above, you can instead\nuse the `spock.replicate_ddl` function to manually replicate DDL statements.\nFor example:\n\n```sql\nSELECT spock.replicate_ddl('CREATE TABLE public.users (id uuid, name text, PRIMARY KEY (id))');\n```\n\nThe `users` table will now exist _on all nodes_. Now you can add the table to the\ndefault replication set by executing this command on all nodes:\n\n```sql\nSELECT spock.repset_add_all_tables('default', ARRAY['public']);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgedge%2Fpgedge-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgedge%2Fpgedge-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgedge%2Fpgedge-docker/lists"}