Skip to main content

Lambda + API Gateway FAQ

Can I use my own Dockerfile?

Yes. Add a dockerfile field to your service in code.json:

{
"name": "my_service",
"location": "orig/my_service",
"dockerfile": "orig/my_service/Dockerfile"
}

What your Dockerfile receives

Nar passes these build arguments:

ArgumentDescription
API_NAMEThe service name (e.g., auth)
SHARED_DIRSComma-separated shared library names (e.g., common)

When to use a custom Dockerfile

  • Different language (Node.js, Go, Rust, etc.)
  • Different Python version
  • System dependencies (ffmpeg, imagemagick, etc.)

See the default Dockerfile for reference.