`web-push` not available in docker image
I want to setup web-push but I had to notice that the web-push binary isn't copied inside the docker image in docker/Dockerfile.
COPY --from=base /app/prisma/schema.prisma ./prisma/schema.prisma
COPY --from=base /app/prisma/migrations ./prisma/migrations
COPY --from=base /app/node_modules/prisma ./node_modules/prisma
COPY --from=base /app/node_modules/@prisma ./node_modules/@prisma
COPY --from=base /app/node_modules/sharp ./node_modules/sharp
So you can't use web-push when running in docker.
Thanks for your work I really like SplitPro!
I'm running split-pro in docker and push notifications work perfectly.
split-pro isn't using the web-push binary to send the notifications. It happens here: https://github.com/oss-apps/split-pro/blob/7f71b43c8f9fed8053ef76099542cde30b8ccb11/src/server/notification.ts#L12
Did you correctly set the environment variables:
WEB_PUSH_EMAIL,WEB_PUSH_PUBLIC_KEY,WEB_PUSH_PRIVATE_KEY?
No I see what your issue is. You're supposed to generated the web-push key somewhere else before running the container not inside.
Oh yes you're right. I use docker only for splitpro and wanted to generate the keypair usind the container:
docker compose exec splitpro web-push generate-vapid-keys --json
This wouldn't work so I assumed that the webpush binary was missing inside the container and created PR #219.
Maybe it would be good to specify this in README.md or .env.example that it is not possible to generate the keypair inside the container?
Idea: This is a minmal command to generate the keypair using a docker container:
docker run --rm node:20-alpine3.19 npx web-push generate-vapid-keys --json
node:20-alpine3.19 is the base layer of the split-pro image so you don't download the layers twice when running this command.
Added comment in commit d212c6529e21d7864a9026272a2e8092eb2eba77