Commit 0985ae66 authored by Bunde's avatar Bunde
Browse files

Merge branch '2018-04-tb-docker' into 'master'

setup docker for stage server

See merge request !14
parents 0ae0bd87 1c5075aa
Pipeline #150 passed with stage
in 16 seconds
FROM python:3.6-alpine3.7
ENV PYTHONUNBUFFERED 1
RUN apk update && apk add gcc make nodejs-npm python-dev musl-dev postgresql-dev openldap openldap-dev cyrus-sasl-dev
COPY ./ code/
WORKDIR code/
RUN make install
......@@ -10,20 +10,20 @@ SECRET_KEY = 'i#$kwk(s24ysn+l%+c!*z9u4+45)oex!-s#!bux#wf2pv2cc0d'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
}
}
ALLOWED_HOSTS = [
'localhost',
]
ALLOWED_HOSTS = ['*']
# LDAP
# See https://django-auth-ldap.readthedocs.io/
AUTHENTICATION_BACKENDS.append("django_auth_ldap.backend.LDAPBackend")
AUTH_LDAP_SERVER_URI = 'ldap://localhost'
AUTH_LDAP_SERVER_URI = 'ldap://ldap'
AUTH_LDAP_BIND_DN = 'cn=admin,dc=example,dc=org'
AUTH_LDAP_BIND_PASSWORD = 'admin'
AUTH_LDAP_USER_SEARCH = LDAPSearch('dc=example,dc=org', ldap.SCOPE_SUBTREE, '(uid=%(user)s)')
......@@ -13,6 +13,7 @@ setup(
"Django==2.0.4",
"django-auth-ldap==1.4.0",
"django-bootstrap4==0.0.6",
"django-npm==1.0.0"
"django-npm==1.0.0",
"psycopg2==2.7.4",
],
)
version: '2'
services:
db:
image: postgres
ldap:
container_name: ldap
image: osixia/openldap
......@@ -9,3 +11,18 @@ services:
command: [--copy-service]
volumes:
- ./ldap/dummy_data.ldif:/container/service/slapd/assets/config/bootstrap/ldif/data.ldif
web:
build: castellum_core
environment:
DJANGO_SETTINGS_MODULE: castellum_core.settings.stage
command: >
sh -c "cd castellum_core &&
make bootstrap &&
python castellum_core/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
- ldap
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment