|
| 1 | +services: |
| 2 | + powersync: |
| 3 | + depends_on: |
| 4 | + mongo-rs-init: |
| 5 | + condition: service_completed_successfully |
| 6 | + restart: unless-stopped |
| 7 | + image: journeyapps/powersync-service:latest |
| 8 | + # The unified service runs an API server and replication worker in the same container. |
| 9 | + # These services can be executed in different containers by using individual entry commands e.g. |
| 10 | + # Start only the API server with |
| 11 | + # command: ['start', '-r', 'api'] |
| 12 | + # Start only the replication worker with |
| 13 | + # command: ['start', '-r', 'sync'] |
| 14 | + |
| 15 | + # Migations occur automatically by default. Default migrations can be disabled in `powersync.yaml`: |
| 16 | + # migrations: |
| 17 | + # disable_auto_migration: true |
| 18 | + # |
| 19 | + # Service migrations can be manually triggered by starting a container with the |
| 20 | + # following command: |
| 21 | + # command: ['migrate', 'up'] |
| 22 | + # Note that this container must finish executing before starting the sync or unified container. |
| 23 | + command: ["start", "-r", "unified"] |
| 24 | + volumes: |
| 25 | + # Mounts the specified config folder to the container |
| 26 | + # This folder should contain `powersync.yaml and sync_rules.yaml |
| 27 | + - ../config-powersync:/config |
| 28 | + environment: |
| 29 | + # This is the path (inside the container) to the YAML config file |
| 30 | + # Alternatively the config path can be specified in the command |
| 31 | + # e.g: |
| 32 | + # command: ['start', '-r', 'unified', '-c', '/config/powersync.yaml'] |
| 33 | + # |
| 34 | + # The config file can also be specified in Base 64 encoding |
| 35 | + # e.g.: Via an environment variable |
| 36 | + # POWERSYNC_CONFIG_B64: [base64 encoded content] |
| 37 | + # or e.g.: Via a command line parameter |
| 38 | + # command: ['start', '-r', 'unified', '-c64', '[base64 encoded content]'] |
| 39 | + POWERSYNC_CONFIG_PATH: /config/powersync.yaml |
| 40 | + |
| 41 | + # Sync rules can be specified as base 64 encoded YAML |
| 42 | + # e.g: Via an environment variable |
| 43 | + # POWERSYNC_SYNC_RULES_B64: "[base64 encoded sync rules]" |
| 44 | + # or e.g.: Via a command line parameter |
| 45 | + # command: ['start', '-r', 'unified', '-sync64', '[base64 encoded content]'] |
| 46 | + |
| 47 | + # The following will be inserted into the powersync.yaml file via templating |
| 48 | + # Templates are used for filesystem and base64 configuration files |
| 49 | + PS_PG_URI: postgres://${PG_DATABASE_USER}:${PG_DATABASE_PASSWORD}@db:${PG_DATABASE_PORT}/${PG_DATABASE_NAME} |
| 50 | + PS_MONGO_URI: mongodb://mongo:27017/powersync_demo |
| 51 | + |
| 52 | + # Note that powersync.yaml->client_auth->allow_local_jwks must be true for local URLs to work |
| 53 | + PS_JWKS_URL: ${PS_JWKS_URL} |
| 54 | + |
| 55 | + # The port which the PowerSync API server should run on |
| 56 | + PS_PORT: ${PS_PORT} |
| 57 | + |
| 58 | + # CA certificate for Postgres connection |
| 59 | + # PS_PG_CA_CERT: |
| 60 | + |
| 61 | + # Client certificate for Postgres connection |
| 62 | + # PS_PG_CLIENT_CERT: |
| 63 | + |
| 64 | + # Client private key for Postgres connection |
| 65 | + # PS_PG_CLIENT_PRIVATE_KEY: |
| 66 | + |
| 67 | + # Potential JWKs public key template |
| 68 | + # PS_JWK_N: |
| 69 | + # PS_JWK_E: |
| 70 | + # PS_JWK_KID: |
| 71 | + |
| 72 | + ports: |
| 73 | + - ${PS_PORT}:${PS_PORT} |
0 commit comments