Hi, I tried running supertokens (the binary) in aw...
# support-questions-legacy
c
Hi, I tried running supertokens (the binary) in aws lambda and it doesn't seem to work. What I did was I downloaded the supertokens-postgresql binary, dockerize it by copying the binary over to the docker image and installing it there. I tried to "docker ps" into it and ran "supertokens start" and it worked. However, when I deploy the image to AWS lambda it fails to run everytime. Hence, I set the erro flag in config.yaml to "null" so that the error would show in std-in, and what I found was always a java exception, something related to read-only file system. I suspect this is because aws lambda has the entire file system as read-only, except for /tmp. But Supertokens is trying to write to /usr/lib/supertoken/webserver-temp. Any idea about this? I essentially tried to run "supertokens start" when the lambda function is triggered but failed to do so.
r
hey @chunkygoo.
I don't think it's the best idea to run supertokens docker image in aws lambda.
But either way, the core tries to write to inside the docker image. So if you run it using a shared volume such that
/usr/lib/supertoken/
(inside the docker image) is shared with a writable path on the host machine / AWS lambda env, then it should work
c
Thanks rp, I don't think it's a good idea either since supertokens has to start up every time. Do you know of any good resources about the share volume you mentioned?
That’s how I learnt about them ^
But I would really recommend not to run the supertokens core in a lambda. It has several cronjobs that just won’t be able to do their jobs.
You should checkout services that can help you run docker images on their own.
Or you could use our managed service
c
What do you mean by "services that can help you run docker images on their own"?
I wanted to use lambda because it's cheap 😂
c
@rp_st where will we be notified once Lmabda support for supertokens_python is released?
r
Hey @chunkygoo. you can watch this issue: https://github.com/supertokens/docs/issues/464
13 Views