Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix docker configurations
  • Loading branch information
level09 committed Sep 4, 2018
1 parent b671cd7 commit 9682ed8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 7 deletions.
21 changes: 18 additions & 3 deletions docker-compose.yml
Expand Up @@ -6,13 +6,13 @@ services:
env_file:
- '.env'
volumes:
- 'enferno:/var/lib/postgresql/data'
- 'db:/var/lib/postgresql/data'
ports:
- '5432:5432'

redis:
image: 'redis:3.0-alpine'
command: redis-server --requirepass verystrongpass
command: redis-server
volumes:
- 'redis:/var/lib/redis/data'
ports:
Expand All @@ -23,18 +23,33 @@ services:
env_file:
- '.env'
volumes:
- '.:/enferno-plat'
- 'enferno:/enferno-plat'
links:
- redis
ports:
- '8000:5000'


nginx:
restart: always
build: ./nginx/
ports:
- "80:80"
links:
- website

celery:
build: .
command: celery worker -B -l info -A enferno.tasks
env_file:
- '.env'
links:
- redis
volumes:
- '.:/enferno-plat'


volumes:
enferno:
redis:
db:
8 changes: 4 additions & 4 deletions enferno/settings.py
Expand Up @@ -11,12 +11,12 @@ class Config(object):
DEBUG_TB_ENABLED = False # Disable Debug toolbar
DEBUG_TB_INTERCEPT_REDIRECTS = False
CACHE_TYPE = 'simple' # Can be "memcached", "redis", etc.
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/enferno.db'
#SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/enferno.db'
#for postgres
#SQLALCHEMY_DATABASE_URI = 'postgresql://level09:@localhost/enferno'
SQLALCHEMY_DATABASE_URI = 'postgresql://enferno:verystrongpass@postgres/enferno'
SQLALCHEMY_TRACK_MODIFICATIONS = True
CELERY_BROKER_URL = 'redis://localhost:6379/10'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/11'
CELERY_BROKER_URL = 'redis://redis:6379/10'
CELERY_RESULT_BACKEND = 'redis://redis:6379/11'


#security
Expand Down
3 changes: 3 additions & 0 deletions nginx/Dockerfile
@@ -0,0 +1,3 @@
FROM tutum/nginx
RUN rm /etc/nginx/sites-enabled/default
ADD sites-enabled/ /etc/nginx/sites-enabled
14 changes: 14 additions & 0 deletions nginx/sites-enabled/app
@@ -0,0 +1,14 @@
server {

listen 80;
server_name 0.0.0.0;
charset utf-8;

location / {
proxy_pass http://website:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

0 comments on commit 9682ed8

Please sign in to comment.