Modify copying files in Dockerfile to rely more on volume
Move entrypoint
This commit is contained in:
parent
eb01d32071
commit
5c46df0b2a
19
Dockerfile
19
Dockerfile
@ -30,13 +30,14 @@ WORKDIR /code
|
||||
|
||||
RUN apk update && apk add nginx && apk add supervisor
|
||||
|
||||
COPY requirements/base.txt .
|
||||
COPY requirements/production.txt .
|
||||
RUN mkdir requirements
|
||||
|
||||
RUN pip install -r production.txt
|
||||
COPY requirements/base.txt requirements/base.txt
|
||||
COPY requirements/production.txt requirements/production.txt
|
||||
RUN pip install -r requirements/production.txt
|
||||
|
||||
COPY requirements/web.txt .
|
||||
RUN pip install -r web.txt
|
||||
COPY requirements/web.txt requirements/web.txt
|
||||
RUN pip install -r requirements/web.txt
|
||||
|
||||
RUN rm -f /etc/nginx/sites-enabled/default
|
||||
RUN rm -f /etc/nginx/conf.d/default.conf
|
||||
@ -53,12 +54,6 @@ RUN rm -rf /tmp/*
|
||||
RUN mkdir -p /tmp/logs/nginx
|
||||
RUN mkdir -p /tmp/logs/geeksbot
|
||||
RUN mkdir -p /code/geeksbot_web
|
||||
COPY ./* /code/
|
||||
|
||||
WORKDIR /code/geeksbot_web
|
||||
|
||||
# RUN sed -i 's/\r$//g' ./entrypoint
|
||||
# RUN chmod +x ./entrypoint
|
||||
|
||||
# PostgreSQL DB Connection Info
|
||||
ENV POSTGRES_HOST geeksbot-db.c3omjx35ryzn.us-east-1.rds.amazonaws.com
|
||||
@ -87,4 +82,6 @@ ENV WEB_CONCURRENCY 4
|
||||
|
||||
EXPOSE 80 8000 443
|
||||
|
||||
COPY entrypoint .
|
||||
|
||||
ENTRYPOINT [ "./entrypoint" ]
|
||||
|
||||
@ -4,6 +4,8 @@ set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
|
||||
cd geeksbot_web
|
||||
|
||||
python manage.py collectstatic --noinput
|
||||
python manage.py makemigrations --noinput
|
||||
python manage.py migrate
|
||||
12
user_data.sh
Normal file
12
user_data.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/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
|
||||
Loading…
x
Reference in New Issue
Block a user