@powersync/cli-plugin-docker 0.9.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ -- Storage database is created by the Postgres image from POSTGRES_DB (e.g. powersync_storage).
2
+ -- Add any extra schema or grants here if needed.
@@ -0,0 +1,26 @@
1
+ # Storage module: PostgreSQL for PowerSync bucket metadata.
2
+ # Paths are relative to this file's directory when using include (Compose resolves from the included file).
3
+ # Include from main: path: modules/storage-postgres/postgres.storage.compose.yaml
4
+
5
+ services:
6
+ pg-storage:
7
+ image: postgres:18
8
+ restart: always
9
+ environment:
10
+ - POSTGRES_USER=${PS_STORAGE_USER}
11
+ - POSTGRES_DB=${PS_STORAGE_DATABASE}
12
+ - POSTGRES_PASSWORD=${PS_STORAGE_PASSWORD}
13
+ - PGPORT=${PS_STORAGE_PORT}
14
+ volumes:
15
+ - pg_storage_data:/var/lib/postgresql
16
+ - ./init-scripts:/docker-entrypoint-initdb.d
17
+ ports:
18
+ - '${PS_STORAGE_PORT}:${PS_STORAGE_PORT}'
19
+ healthcheck:
20
+ test: ['CMD-SHELL', 'pg_isready -U ${PS_STORAGE_USER} -d ${PS_STORAGE_DATABASE}']
21
+ interval: 5s
22
+ timeout: 5s
23
+ retries: 5
24
+
25
+ volumes:
26
+ pg_storage_data:
@@ -0,0 +1,32 @@
1
+ # Composed PowerSync Docker stack (generated by powersync docker configure).
2
+ # Modules add entries to include and to services.powersync.depends_on.
3
+ # Relative paths: . = powersync/docker, .. = powersync.
4
+ # Include syntax requires Docker Compose v2.20.3+
5
+
6
+ include: []
7
+
8
+ services:
9
+ powersync:
10
+ restart: unless-stopped
11
+ image: journeyapps/powersync-service:latest
12
+ command: ['start', '-r', 'unified']
13
+ env_file:
14
+ - .env
15
+ volumes:
16
+ - ../service.yaml:/config/service.yaml
17
+ - ../sync-config.yaml:/config/sync-config.yaml
18
+ environment:
19
+ POWERSYNC_CONFIG_PATH: /config/service.yaml
20
+ NODE_OPTIONS: --max-old-space-size=1000
21
+ healthcheck:
22
+ test:
23
+ - 'CMD'
24
+ - 'node'
25
+ - '-e'
26
+ - "fetch('http://localhost:${PS_PORT:-8080}/probes/liveness').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
27
+ interval: 5s
28
+ timeout: 1s
29
+ retries: 15
30
+ ports:
31
+ - '${PS_PORT:-8080}:${PS_PORT:-8080}'
32
+ depends_on: {}
@@ -0,0 +1,15 @@
1
+ -- PowerSync logical replication requires a PostgreSQL publication.
2
+ -- Create a publication named "powersync" that includes the tables
3
+ -- mentioned in your sync config (sync-config.yaml). This script uses
4
+ -- FOR ALL TABLES so any tables you create are replicated; for production
5
+ -- you may create a publication that lists only the tables used in sync-config.yaml.
6
+ --
7
+ -- Example for a single table: CREATE PUBLICATION powersync FOR TABLE my_table;
8
+ -- Example for multiple: CREATE PUBLICATION powersync FOR TABLE t1, t2, t3;
9
+ --
10
+ -- Note: Init scripts run only when the Postgres data directory is empty (first
11
+ -- container start). If you see "Publication 'powersync' does not exist", remove
12
+ -- the database volume and redeploy so init runs again, e.g.:
13
+ -- powersync docker stop --remove --remove-volumes && powersync docker reset
14
+
15
+ CREATE PUBLICATION powersync FOR ALL TABLES;
@@ -0,0 +1,27 @@
1
+ # Database module: PostgreSQL for replication source (logical replication).
2
+ # Paths are relative to this file's directory when using include (Compose resolves from the included file).
3
+ # Include from main: path: modules/database-postgres/postgres.database.compose.yaml
4
+
5
+ services:
6
+ pg-db:
7
+ image: postgres:18
8
+ restart: always
9
+ environment:
10
+ - POSTGRES_USER=${PS_DATABASE_USER}
11
+ - POSTGRES_DB=${PS_DATABASE_NAME}
12
+ - POSTGRES_PASSWORD=${PS_DATABASE_PASSWORD}
13
+ - PGPORT=${PS_DATABASE_PORT}
14
+ volumes:
15
+ - pg_data:/var/lib/postgresql
16
+ - ./init-scripts:/docker-entrypoint-initdb.d
17
+ ports:
18
+ - '${PS_DATABASE_PORT}:${PS_DATABASE_PORT}'
19
+ command: ['postgres', '-c', 'wal_level=logical']
20
+ healthcheck:
21
+ test: ['CMD-SHELL', 'pg_isready -U ${PS_DATABASE_USER} -d ${PS_DATABASE_NAME}']
22
+ interval: 5s
23
+ timeout: 5s
24
+ retries: 5
25
+
26
+ volumes:
27
+ pg_data:
@@ -274,5 +274,5 @@
274
274
  ]
275
275
  }
276
276
  },
277
- "version": "0.9.0"
277
+ "version": "0.9.2"
278
278
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@powersync/cli-plugin-docker",
3
3
  "description": "PowerSync CLI plugin: reset, start, and stop self-hosted instances using Docker Compose",
4
- "version": "0.9.0",
4
+ "version": "0.9.2",
5
5
  "author": "POWERSYNC",
6
6
  "license": "FSL-1.1-ALv2",
7
7
  "type": "module",
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "@inquirer/prompts": "^7.2.0",
26
26
  "@oclif/core": "^4",
27
+ "@powersync/service-schema": "^1.20.1",
27
28
  "@powersync/service-types": "^0.15.0",
28
- "@powersync/service-schema": "^1.20.0",
29
29
  "yaml": "^2",
30
- "@powersync/cli-core": "0.9.0",
31
- "@powersync/cli-schemas": "0.9.0"
30
+ "@powersync/cli-core": "0.9.2",
31
+ "@powersync/cli-schemas": "0.9.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^24",
@@ -49,6 +49,7 @@
49
49
  }
50
50
  },
51
51
  "scripts": {
52
+ "build": "tsc -b && node scripts/copy-template-resources.mjs",
52
53
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
53
54
  "lint": "eslint ."
54
55
  }