Skip to content

Instantly share code, notes, and snippets.

@evzpav
Last active April 30, 2020 19:15
Show Gist options
  • Save evzpav/52fa29a1cbd603bc5de6926ef8e7b649 to your computer and use it in GitHub Desktop.
Save evzpav/52fa29a1cbd603bc5de6926ef8e7b649 to your computer and use it in GitHub Desktop.
Config to run Gatsby on Dokku
#static.json on root project:
{
"root": "public/",
"headers": {
"/**": {
"Cache-Control": "public, max-age=0, must-revalidate"
},
"/**.css": {
"Cache-Control": "public, max-age=31536000, immutable"
},
"/**.js": {
"Cache-Control": "public, max-age=31536000, immutable"
},
"/static/**": {
"Cache-Control": "public, max-age=31536000, immutable"
},
"/icons/*.png": {
"Cache-Control": "public, max-age=31536000, immutable"
}
},
"https_only": true,
"error_page": "404.html"
}
#app.json on root project:
{
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
},
{
"url": "https://github.com/heroku/heroku-buildpack-static"
}
]
}
#.buildpacks on root project:
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-static.git
# create deploy script
echo "
#!/bin/bash
git add .
git commit -m \"up to dokku\"
git push dokku master " > up_dokku.sh
chmod 700 up_dokku.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment