Reputation: 16415
Is it possible to install Sonatype Nexus on a Micro Instance of Elasticbean Stalk instance ? Can anyone point me to how to do this ?
Upvotes: 1
Views: 519
Reputation: 2207
You can user beanstalk docker stack and attach volume dynamically to it.
Dockerrun.aws.json :
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "sonatype/nexus3:3.21.1",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "8081"
},
{
"ContainerPort": 8082,
"HostPort": 8082
},
{
"ContainerPort": 8083,
"HostPort": 8083
}
],
"Volumes": [
{
"HostDirectory": "/media/ebs_volume/nexus-data",
"ContainerDirectory": "/nexus-data"
}
]
}
.ebextensions/00_volume.config :
commands:
01-attach-volume:
command: aws ec2 attach-volume --region eu-west-1 --volume-id vol-xxxxxxxxxxxxx --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --device /dev/sdh
ignoreErrors: true
02-wait:
command: sleep 30
03-attach-volume:
command: |
aws ec2 modify-instance-attribute --region eu-west-1 --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"DeleteOnTermination\":false}}]"
ignoreErrors: true
04-mount-volume:
command: |
mkdir -p /media/ebs_volume
mount /dev/sdh /media/ebs_volume
service docker restart
test: sh -c "! grep -qs '/media/ebs_volume' /proc/mounts"
05-create-data-folder:
command: |
mkdir -p /media/ebs_volume/nexus-data && chown -R 200:200 /media/ebs_volume/nexus-data
ignoreErrors: true
And you may need to tune nginx configuration ( for uploads )
.ebextensions/01_nginx_custom.config :
files:
"/etc/nginx/conf.d/proxy.conf":
mode: "000755"
group: root
group: root
content: |
client_max_body_size 512M;
Upvotes: 1
Reputation: 5827
Sonatype Nexus can't deploy in a servlet container or alternative application server [1].
So you must replace the default tomcat server with Sonatype Nexus application server. I think you can try to use custom elastic beanstalk AMI to accomplish it.
Upvotes: 0