-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from Osmose/docker-fig
Add files and documentation for running the site using docker and fig.
- Loading branch information
Showing
9 changed files
with
133 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM python:2.7 | ||
RUN apt-get update && apt-get install -y libmysqlclient-dev gettext libjpeg62-turbo-dev | ||
|
||
WORKDIR /app | ||
|
||
# First copy requirements.txt and peep so we can take advantage of | ||
# docker caching. | ||
COPY requirements /tmp/requirements | ||
RUN pip install -r /tmp/requirements/dev.txt | ||
|
||
EXPOSE 8000 | ||
ENV PYTHONUNBUFFERED 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./manage.py runserver 0.0.0.0:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
./manage.py syncdb | ||
./manage.py migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
db: | ||
image: mysql:5.7 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=asdf | ||
- MYSQL_USER=snippets | ||
- MYSQL_PASSWORD=asdf | ||
- MYSQL_DATABASE=snippets | ||
web: | ||
build: . | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- .:/app | ||
links: | ||
- db | ||
environment: | ||
- PYTHONDONTWRITEBYTECODE=1 | ||
- DOCKER=1 | ||
command: ./bin/run-fig.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#-r ../vendor/src/funfactory/funfactory/requirements/compiled.txt | ||
MySQL-python==1.2.3c1 | ||
Jinja2==2.5.5 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ nose==1.0.0 | |
|
||
# L10n | ||
translate-toolkit==1.8.0 | ||
|
||
# Etc. | ||
six |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from . import base | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'snippets', | ||
'USER': 'snippets', | ||
'PASSWORD': 'asdf', | ||
'HOST': 'db', | ||
'PORT': '', | ||
'OPTIONS': { | ||
'init_command': 'SET default_storage_engine=InnoDB', | ||
'charset' : 'utf8', | ||
'use_unicode' : True, | ||
}, | ||
'TEST_CHARSET': 'utf8', | ||
'TEST_COLLATION': 'utf8_general_ci', | ||
}, | ||
} | ||
|
||
DEBUG = TEMPLATE_DEBUG = True | ||
|
||
HMAC_KEYS = { | ||
'2012-06-06': 'some secret', | ||
} | ||
|
||
from django_sha2 import get_password_hashers | ||
PASSWORD_HASHERS = get_password_hashers(base.BASE_PASSWORD_HASHERS, HMAC_KEYS) | ||
|
||
# Make this unique, and don't share it with anybody. It cannot be blank. | ||
SECRET_KEY = 'dev' | ||
|
||
# Should robots.txt allow web crawlers? Set this to True for production | ||
ENGAGE_ROBOTS = True | ||
|
||
SESSION_COOKIE_SECURE = False | ||
|
||
# Snippets-specific caching | ||
SNIPPET_HTTP_MAX_AGE = 90 # Time to cache HTTP responses for snippets. | ||
|
||
# Replace with site protocol, domain, and (optionally) port. | ||
SITE_URL = 'http://docker:8000' |