Fork me on GitHub
#pedestal
<
2018-03-20
>
ddeaguiar12:03:36

@amarjeet, FWIW, I find it easiest to deploy Pedestal services to ElasticBeanstalk in a Docker container.

amarjeet12:03:51

@ddeaguiar I think I can try that

ddeaguiar13:03:46

The lein pedestal-service template creates a Dockerfile which should be suitable for most cases. Keep in mind that EB uses nginx to proxy all requests to your container so you may need to create an nginx config file if you need control over that.

amarjeet14:03:35

okay, just started with this. lets see if I can make it work

ddeaguiar14:03:32

It should be straight forward. You’ll just need to create a Dockerrun.aws.json file. I recommend using the eb cli for pushing change to you environment.

amarjeet14:03:20

tried building docker image, its not been able to build. Error: `Get https://registry-1.docker.io/v2/: dial tcp: lookup http://registry-1.docker.io on 192.168.65.1:53: read udp 192.168.65.2:45426->192.168.65.1:53: i/o timeout Docker image could not be built.`

amarjeet14:03:45

m updating docker - lets see

amarjeet15:03:51

@ddeaguiar any clear way to create a jar build? I am getting this error - javax/servlet/http/HttpServletRequest

amarjeet15:03:11

i tried lein uberjar

ddeaguiar15:03:50

Creating an uberjar should just work. You need to undo the changes you made to create a war file

amarjeet15:03:33

I will try by creating a fresh pedestal service app

amarjeet16:03:31

Are both the situations incorrect, in terms of config?

amarjeet17:03:48

Uberjar issue resolved

amarjeet17:03:36

Hey @ddeaguiar I am able to run the docker image locally, but the beanstalk is not recognizing Dockerfile when I am deploying standalone.jar

amarjeet17:03:45

I am doing it via the beanstalk consol

ddeaguiar17:03:23

@amarjeet did you create a Dockerrun.aws.json file?

amarjeet17:03:02

no, i thought Dockerfile would work

ddeaguiar17:03:12

nope, you need one more piece

ddeaguiar17:03:04

You can provide Elastic Beanstalk with only the Dockerrun.aws.json file, or with a .zip archive containing both the Dockerrun.aws.json and Dockerfile files. When you provide both files, the Dockerfile describes the Docker image and the Dockerrun.aws.json file provides additional information for deployment as described later in this section.

ddeaguiar17:03:48

so there are a couple ways to do this, you can deploy your docker image to an ecs registry repo or build the image at deployment time

ddeaguiar17:03:58

I do the later when working with EB

amarjeet17:03:04

so, it seems like the configs in this file are created when I was creating the beanstalk environment, so any specific part of the config should I mention (thats is mandatory) in the .json file

ddeaguiar17:03:37

The config you need in that file is minimal

ddeaguiar17:03:24

it will amount to environment variable mappings (if any), port mappings, memory settings and log mount points

amarjeet17:03:39

will just try

ddeaguiar17:03:51

my recommendation is to just first deploy a vanilla pedestal-service

ddeaguiar17:03:12

once you have that working, then deploy your app which can have external dependencies

ddeaguiar17:03:42

you can then tailor your eb config to create the roles required to access aws services, etc

amarjeet17:03:01

gonna try this