This repository contains the deployment files for the Slax Reader PowerSync service.
- You need to use
cp .env.example .envto create a .env file, and then edit the .env file to set the environment variables. - use
git clone https://github.com/powersync-ja/self-host-demo.git, this will create aself-host-demofolder. cd self-host-demo && npm install && npm run start- The YAML form of the public key will be printed to the console. Add this to the client_auth->jwks->keys section of ./config/powersync.yaml.
- The DEMO_JWKS_PUBLIC_KEY and DEMO_JWKS_PUBLIC_KEY values will be printed to the console. Add these values to the .env file in the root of the repository.
- You need to use
cp ./config/nginx.conf.example ./config/nginx.confand edit the nginx.conf file to set the nginx configuration.
Deploy PowerSync's API and sync service
docker compose -f ./docker-compose-full.yaml up -d --scale powersync-api=5docker-compose -f ./docker-compose-full.yaml up -d --scale powersync-api=2Deploy PowerSync's API service
docker compose -f ./docker-compose-api.yaml up -d --scale powersync-api=5docker-compose -f ./docker-compose-api.yaml up -d --scale powersync-api=2docker compose -f docker-compose-full.yaml run --rm powersync-sync compact
cat >> /etc/sysctl.conf <<EOF
fs.file-max = 200000
net.core.somaxconn = 32768
net.ipv4.ip_local_port_range = 1024 65535
EOF
sudo sysctl -p
cat >> /etc/security/limits.conf <<EOF
* soft nofile 65535
* hard nofile 65535
root soft nofile 65535
root hard nofile 65535
EOF