Is there a docker image that mimics aws amplify environment

Viewed 181

We have a react web app that is hosted on AWS Amplify.

I am trying to get write a Dockerfile for our devs to have a consistent development environment that matches the AWS Amplify environment.

I know you can deploy to Amplify using an image, but we will NOT be doing that at this time as we don't have capacity to get that done. This is just for matching local development to the deployment environment.

Does there exist a docker image that I can use that mimics the aws amplify environment? I know this exists for AWS Lambdas already. Hopefully there is one that has nvm installed that way I can make our node version consistent between the deployment environment and the docker container I'm creating.

1 Answers

I think we need to know more about your environment to answer fully.

For example are you using API Gateway or DynamoDB? If so then emulating that cloud environment in a docker container would involve bundling up the those AWS services in containers and they aren't opensource so not really possible as far as I know. And if they were that would likely be more trouble than it's worth.

But if you wanted to just make the developer environment consistent, then I would think more at the level loading the docker container with tools that everyone needs. Which CLI tools, node versions, etc do you want to standardize? Make a basic docker container with your node version and the amplify cli and have your developers use that as their day to day workspace.

Personally, I've gone down this rabbit hole of setting up elaborate developer environments and I've found that they can quickly become tricky to and cumbersome to maintain. I've opted for standardizing the tools with just documentation that tells everyone which tools to install and use and standardizing the node version by making everyone use nvm and then putting an .nvmrc file in the root of the project which auto switches to the correct version when someone enters the directory in their terminal.

But again, it really depends on how you are using amplify. If you are using the serverless backend then in my mind that solves most of the problem people were trying to solve with developer docker environments. That was a solution to the problem of the many different side services (postgresql, redis, node, etc...) that the project was dependent to run. With Amplify you really only have node and a few other tools, but you don't, for example need to install redis or mysql or something.

Related