mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
First pass using docker
This commit is contained in:
parent
5f875db3f9
commit
7eff7ade7a
5 changed files with 224 additions and 0 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
|||
.git
|
42
docker-compose.yml
Normal file
42
docker-compose.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
|
||||
newsblur:
|
||||
build: .
|
||||
dockerfile: docker/Dockerfile
|
||||
links:
|
||||
- mongo
|
||||
- postgres
|
||||
- elasticsearch
|
||||
- redis
|
||||
ports:
|
||||
- '80:8000'
|
||||
command: tail -f urls.py
|
||||
|
||||
|
||||
postgres:
|
||||
image: postgres:9
|
||||
environment:
|
||||
- POSTGRES_USER=newsblur
|
||||
- POSTGRES_PASSWORD=newsblur
|
||||
ports:
|
||||
- '3306:3306'
|
||||
|
||||
|
||||
redis:
|
||||
image: redis:3
|
||||
ports:
|
||||
- '6379:6379'
|
||||
|
||||
|
||||
elasticsearch:
|
||||
image: elasticsearch:1.7
|
||||
ports:
|
||||
- '9200:9200'
|
||||
|
||||
|
||||
|
||||
mongo:
|
||||
image: mongo:3
|
||||
ports:
|
||||
- '27017:27017'
|
||||
command: mongod --smallfiles
|
13
docker/Dockerfile
Normal file
13
docker/Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
|||
FROM debian:jessie
|
||||
MAINTAINER julien@rottenberg.info
|
||||
|
||||
|
||||
WORKDIR /opt/newsblur
|
||||
#
|
||||
RUN apt-get update && apt-get install -y python-pip python-requests-whl python-dev libxslt1-dev libxml2-dev zlib1g-dev lib32ncurses5-dev libjpeg-dev libpq-dev libblas-dev liblapack-dev gfortran
|
||||
COPY requirements.txt /opt/newsblur/
|
||||
RUN pip install -r requirements.txt; pip install image psycopg2 numpy scipy
|
||||
|
||||
COPY . /opt/newsblur/
|
||||
RUN cp docker/local_settings.py .
|
||||
CMD ./manage.py runserver 0.0.0.0:8000
|
19
docker/README.md
Normal file
19
docker/README.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
Docker related informations
|
||||
===========================
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
pip and requests https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744145
|
||||
|
||||
for PIL (image) libjpeg-dev
|
||||
|
||||
DEVELOPMENT just based on presence of /Users in code dir
|
||||
|
||||
psycopg2 commented out ?
|
||||
|
||||
Missing from template : REDIS_SESSIONS, postgresql_psycopg2
|
||||
|
||||
./manage.py syncdb --all --noinput
|
||||
|
||||
pip numpy , scipy + apt gfortran libblas-dev liblapack-dev for ./manage.py refresh_feeds --force
|
149
docker/local_settings.py
Normal file
149
docker/local_settings.py
Normal file
|
@ -0,0 +1,149 @@
|
|||
import logging
|
||||
import pymongo
|
||||
|
||||
# ===================
|
||||
# = Server Settings =
|
||||
# ===================
|
||||
|
||||
ADMINS = (
|
||||
('Samuel Clay', 'samuel@newsblur.com'),
|
||||
)
|
||||
|
||||
SERVER_EMAIL = 'server@newsblur.com'
|
||||
HELLO_EMAIL = 'hello@newsblur.com'
|
||||
NEWSBLUR_URL = 'http://www.newsblur.com'
|
||||
SESSION_COOKIE_DOMAIN = '.localhost'
|
||||
|
||||
# ===================
|
||||
# = Global Settings =
|
||||
# ===================
|
||||
|
||||
DEBUG = True
|
||||
DEBUG_ASSETS = DEBUG
|
||||
MEDIA_URL = '/media/'
|
||||
SECRET_KEY = 'YOUR SECRET KEY'
|
||||
AUTO_PREMIUM_NEW_USERS = True
|
||||
AUTO_ENABLE_NEW_USERS = True
|
||||
|
||||
# CACHE_BACKEND = 'dummy:///'
|
||||
# CACHE_BACKEND = 'locmem:///'
|
||||
# CACHE_BACKEND = 'memcached://127.0.0.1:11211'
|
||||
|
||||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'redis_cache.RedisCache',
|
||||
'LOCATION': 'redis:6379',
|
||||
'OPTIONS': {
|
||||
'DB': 6,
|
||||
'PARSER_CLASS': 'redis.connection.HiredisParser'
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
|
||||
# Set this to the username that is shown on the homepage to unauthenticated users.
|
||||
HOMEPAGE_USERNAME = 'popular'
|
||||
|
||||
# Google Reader OAuth API Keys
|
||||
OAUTH_KEY = 'www.example.com'
|
||||
OAUTH_SECRET = 'SECRET_KEY_FROM_GOOGLE'
|
||||
|
||||
S3_ACCESS_KEY = 'XXX'
|
||||
S3_SECRET = 'SECRET'
|
||||
S3_BACKUP_BUCKET = 'newsblur_backups'
|
||||
S3_PAGES_BUCKET_NAME = 'pages-XXX.newsblur.com'
|
||||
S3_ICONS_BUCKET_NAME = 'icons-XXX.newsblur.com'
|
||||
|
||||
STRIPE_SECRET = "YOUR-SECRET-API-KEY"
|
||||
STRIPE_PUBLISHABLE = "YOUR-PUBLISHABLE-API-KEY"
|
||||
|
||||
# ===============
|
||||
# = Social APIs =
|
||||
# ===============
|
||||
|
||||
FACEBOOK_APP_ID = '111111111111111'
|
||||
FACEBOOK_SECRET = '99999999999999999999999999999999'
|
||||
TWITTER_CONSUMER_KEY = 'ooooooooooooooooooooo'
|
||||
TWITTER_CONSUMER_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
|
||||
YOUTUBE_API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
|
||||
# =============
|
||||
# = Databases =
|
||||
# =============
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'NAME': 'newsblur',
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'USER': 'newsblur',
|
||||
'PASSWORD': 'newsblur',
|
||||
'HOST': 'postgres',
|
||||
'OPTIONS': {
|
||||
"autocommit": True,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
MONGO_DB = {
|
||||
'name': 'newsblur',
|
||||
'host': 'mongo',
|
||||
'port': 27017
|
||||
}
|
||||
|
||||
MONGO_ANALYTICS_DB = {
|
||||
'name': 'analytics',
|
||||
'host': 'mongo',
|
||||
'port': 27017
|
||||
}
|
||||
|
||||
MONGODB_SLAVE = {
|
||||
'host': 'mongo'
|
||||
}
|
||||
|
||||
# Celery RabbitMQ/Redis Broker
|
||||
BROKER_URL = "redis://redis:6379/0"
|
||||
CELERY_RESULT_BACKEND = BROKER_URL
|
||||
|
||||
REDIS = {
|
||||
'host': 'redis',
|
||||
}
|
||||
REDIS_PUBSUB = {
|
||||
'host': 'redis',
|
||||
}
|
||||
|
||||
REDIS_PUBSUB_POOL = {
|
||||
'host': 'redis',
|
||||
}
|
||||
REDIS_STORY = {
|
||||
'host': 'redis',
|
||||
}
|
||||
REDIS_SESSIONS = {
|
||||
'host': 'redis',
|
||||
}
|
||||
ELASTICSEARCH_FEED_HOSTS = ["elasticsearch:9200"]
|
||||
ELASTICSEARCH_STORY_HOSTS = ["elasticsearch:9200"]
|
||||
|
||||
BACKED_BY_AWS = {
|
||||
'pages_on_node': False,
|
||||
'pages_on_s3': False,
|
||||
'icons_on_s3': False,
|
||||
}
|
||||
|
||||
ORIGINAL_PAGE_SERVER = "127.0.0.1:3060"
|
||||
REMOVE_WWW_FROM_DOMAIN = False
|
||||
|
||||
|
||||
# ===========
|
||||
# = Logging =
|
||||
# ===========
|
||||
|
||||
# Logging (setup for development)
|
||||
LOG_TO_STREAM = True
|
||||
|
||||
if len(logging._handlerList) < 1:
|
||||
LOG_FILE = '/opt/newsblur/logs/development.log'
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format='%(asctime)-12s: %(message)s',
|
||||
datefmt='%b %d %H:%M:%S',
|
||||
handler=logging.StreamHandler)
|
Loading…
Add table
Reference in a new issue