Local Development
Using Docker Compose to simplify your local development stack
It’s possible to host the full PowerSync Service stack on your development machine using pure Docker, but Docker Compose can simplify things.
Below is a minimal Docker Compose setup for self-hosting PowerSync on your development machine. Note that Docker Compose is primarily designed for development and testing environments.
- Create a new folder to work in:
- Create a
docker-compose.yml
file with the below contents:
- Create a config volume that contains a
config.yaml
file, this configured the PowerSync Service itself
Put the below into config.yaml
:
For some additional details on this file, see PowerSync Service Setup.
Next, the client_auth
sections needs to be completed.
The PowerSync service can verify JWTs from client applications using either HMAC (HS*) or RSA (RS*) based algorithms. It can also obtain the necessary settings from Supabase automatically if you are using it.
- In the case of Supabase, simply set the
supabase
key totrue
- In the case of HS* algorithms, specify the secret as base64 encoded in the
k
field. - In the case of RS* based algorithms, the public key(s) can be specified either by supplying a JWKS URI or hard coding the public key in the config file.
- If using a JWKS URI, we have an example endpoint available here; ensure that your response looks similar.
- If hardcoding, see the syntax below. We also have an example key generator script.
example of hard coded HS256 config
Was this page helpful?