Docker support
parent
941b64090b
commit
e2bba4c6db
|
@ -24,6 +24,6 @@ nosetests.xml
|
||||||
*.sqlite
|
*.sqlite
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
|
|
||||||
# Media
|
# Media & Static
|
||||||
media
|
media
|
||||||
staticfiles
|
/staticfiles/*
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM centos:7
|
||||||
|
RUN yum makecache
|
||||||
|
RUN yum -y install epel-release
|
||||||
|
RUN yum -y install -y python python-pip python-devel git gcc libjpeg-turbo-devel libxml2-devel libxslt-devel postgresql-devel
|
||||||
|
RUN yum -y clean all
|
||||||
|
|
||||||
|
COPY ./requirements/ /tmp/requirements/
|
||||||
|
RUN pip install -r /tmp/requirements/docker.txt
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
CMD ["./bin/run-docker.sh"]
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
find ./staticfiles -mindepth 1 -not -name '.gitkeep'| xargs rm -rf
|
||||||
|
./manage.py collectstatic --noinput
|
||||||
|
./manage.py migrate --noinput
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
./bin/run-common.sh
|
||||||
|
gunicorn network.wsgi:application -b 0.0.0.0:80 -w 2 --log-file -
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
./bin/run-common.sh
|
||||||
|
./manage.py runserver 0.0.0.0:8000
|
|
@ -0,0 +1,19 @@
|
||||||
|
db:
|
||||||
|
image: postgres:9.3
|
||||||
|
web:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
links:
|
||||||
|
- db
|
||||||
|
environment:
|
||||||
|
- DJANGO_SETTINGS_MODULE=network.settings.dev
|
||||||
|
- DJANGO_DEFAULT_FROM_EMAIL=noreply@example.com
|
||||||
|
- DJANGO_GOOGLE_ANALYTICS_DOMAIN=auto
|
||||||
|
- DJANGO_GOOGLE_ANALYTICS_PROPERTY_ID=UA-xxxxxxxx-x
|
||||||
|
- DJANGO_ALLOWED_HOSTS=*
|
||||||
|
- DJANGO_DATABASE_URL=postgres://postgres@db/postgres
|
||||||
|
command:
|
||||||
|
./bin/run-fig.sh
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Local development dependencies go here
|
||||||
|
-r dev.txt
|
||||||
|
|
||||||
|
psycopg2==2.5.4
|
Loading…
Reference in New Issue