Move SSL certs to volume

Create user_data script for launch config
This commit is contained in:
Dustin Pianalto 2019-12-25 18:50:57 -09:00
parent 5c46df0b2a
commit 1c214859d4
2 changed files with 1 additions and 11 deletions

View File

@ -46,8 +46,6 @@ COPY ./services/geeksbot.conf /etc/nginx/sites-enabled/geeksbot
COPY ./services/gunicorn.conf /etc/gunicorn.conf
COPY ./services/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./services/supervisor_geeksbot.conf /etc/supervisor/conf.d/geeksbot.conf
COPY ./ssl_certs/geeksbot_app/geeksbot_app_cert_chain.crt /etc/ssl/geeksbot_app_cert_chain.crt
COPY ./ssl_certs/geeksbot_app/geeksbot.app.key /etc/ssl/geeksbot.app.key
RUN rm -rf /tmp/*

10
user_data.sh Normal file → Executable file
View File

@ -1,12 +1,4 @@
#!/bin/bash
yum update -y
export AWS_DEFAULT_REGION='us-east-1'
instance_id=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
aws ec2 associate-address --instance-id $instance_id --public-ip "34.238.62.161"
mkdir /code || exit
cd /code || exit
git clone git@github.com:dustinpianalto/geeksbot_web.git
cd geeksbot_web || exit
docker build . -t geeksbot_web || exit
docker run -d -v /code/geeksbot_web:/code -v /root/.ssh:/root/.ssh:ro --name geeksbot_web --restart always geeksbot_web:latest || exit
docker run -d -v /code/geeksbot_web:/code -v /root/.ssh:/root/.ssh:ro -v /root/ssl_certs:/etc/ssl:ro --name geeksbot_web --restart always geeksbot_web:latest || exit