Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
1716cf6c
Commit
1716cf6c
authored
Mar 18, 2018
by
Guilhem Saurel
Browse files
default DB to postgres only in docker, and activate memcached in docker
parent
60a60e65
Changes
2
Hide whitespace changes
Inline
Side-by-side
dashboard/settings.py
View file @
1716cf6c
...
...
@@ -73,11 +73,11 @@ TEMPLATES = [
WSGI_APPLICATION
=
f
'
{
PROJECT
}
.wsgi.application'
DB
=
environ
.
get
(
'DB'
,
'
postgres
'
)
DB
=
environ
.
get
(
'DB'
,
'
db.sqlite3
'
)
DATABASES
=
{
'default'
:
{
'ENGINE'
:
f
'django.db.backends.sqlite3'
,
'NAME'
:
join
(
BASE_DIR
,
'db.sqlite3'
),
'NAME'
:
join
(
BASE_DIR
,
DB
),
}
}
if
DB
==
'postgres'
:
...
...
@@ -117,12 +117,13 @@ MEDIA_URL = '/media/'
STATIC_URL
=
'/static/'
STATIC_ROOT
=
'/srv/static/'
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.memcached.MemcachedCache'
,
'LOCATION'
:
'memcached:11211'
,
if
os
.
environ
.
get
(
'MEMCACHED'
,
'False'
).
lower
()
==
'true'
:
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.memcached.MemcachedCache'
,
'LOCATION'
:
'memcached:11211'
,
}
}
}
LOGGING
=
{
'version'
:
1
,
...
...
docker-compose.yml
View file @
1716cf6c
...
...
@@ -25,6 +25,9 @@ services:
-
/srv/dashboard/robotpkg:/srv/dashboard/robotpkg
env_file
:
-
.env
environment
:
-
DB=postgres
-
MEMCACHED=True
networks
:
-
traefik
-
default
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment