Skip to content

Instantly share code, notes, and snippets.

@fdnklg
Last active August 19, 2019 10:23
Show Gist options
  • Save fdnklg/d2f9d6c2d9453b71e7a62ea4bf054b40 to your computer and use it in GitHub Desktop.
Save fdnklg/d2f9d6c2d9453b71e7a62ea4bf054b40 to your computer and use it in GitHub Desktop.

How to setup a docker container on an aws elastic beanstalk environment as a single node container

  1. prepare a docker image which runs locally. (You can find a docker image of the routing service here)
  2. setup aws account and create organization with required roles
    • elasticloadbalancing
    • aws-elasticbeanstalk-service-role
  3. Install EB-CLI (Command line interface) and AWS CLI
brew install awscli
brew install awsebcli
  1. Inside folder of docker image create Dockerrun.aws.json and setup work environment
{
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "osrm/osrm-backend",
    "Update": "true"
  },
  "Ports": [
    {
      "ContainerPort": "5000"
    }
  ],
  "Volumes": [
    {
      "HostDirectory": "/var/app/current",
      "ContainerDirectory": "/data"
    }
  ],
  "Entrypoint": "osrm-routed",
  "Command": "/data/berlin-latest.osrm"
}
  1. access server instance via ssh (helpful to clear up folder structure) and find path directories for volumes in Dockerrun.aws.json
eb ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment