Skip to content

Instantly share code, notes, and snippets.

@hmontazeri
Created August 12, 2020 08:27
Show Gist options
  • Save hmontazeri/38cd4cd339619991a810599d6e91c245 to your computer and use it in GitHub Desktop.
Save hmontazeri/38cd4cd339619991a810599d6e91c245 to your computer and use it in GitHub Desktop.
Deploy serverless app using docker (ffmpeg linux64 workaround)
#!/bin/bash
if [ -x "$(command -v docker)" ]; then
echo "docker installed..."
echo "running deploy..."
docker run \
-v $(pwd):/app \
-v ~/.aws/credentials:/root/.aws/credentials \
node:12 /bin/bash \
-c "cd /app; npm i -g serverless; npm install; sls deploy"
else
echo "Install docker"
exit 1
fi
@hmontazeri
Copy link
Author

hmontazeri commented Aug 12, 2020

I had the problem that ffmpeg-installer uses current OS to choose the correct build for its ffmpeg binaries. Works fine if you build and run in the same env.

-> Problem building the node app on OSX and deploying to Linux (AWS Lambda) ENV didn't work, so I wrote this little shell script as a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment