1
0
Fork 0

Docker support

merge-requests/100/head
Nikos Roussos 2015-03-10 17:01:22 +02:00
parent 941b64090b
commit e2bba4c6db
8 changed files with 53 additions and 2 deletions

4
.gitignore vendored
View File

@ -24,6 +24,6 @@ nosetests.xml
*.sqlite
*.sqlite3
# Media
# Media & Static
media
staticfiles
/staticfiles/*

15
Dockerfile 100644
View File

@ -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"]

View File

@ -0,0 +1,5 @@
#!/bin/bash
find ./staticfiles -mindepth 1 -not -name '.gitkeep'| xargs rm -rf
./manage.py collectstatic --noinput
./manage.py migrate --noinput

View File

@ -0,0 +1,4 @@
#!/bin/sh
./bin/run-common.sh
gunicorn network.wsgi:application -b 0.0.0.0:80 -w 2 --log-file -

4
bin/run-fig.sh 100755
View File

@ -0,0 +1,4 @@
#!/bin/sh
./bin/run-common.sh
./manage.py runserver 0.0.0.0:8000

19
fig.yml 100644
View File

@ -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

View File

@ -0,0 +1,4 @@
# Local development dependencies go here
-r dev.txt
psycopg2==2.5.4

View File