Skip to content

Commit

Permalink
Adjust how we build and start container services together
Browse files Browse the repository at this point in the history
- they need to be started via docker-compose which by default
  puts them on the same network and they are accessible to one
  another!

- also create a superuser in the DB. There is no valid password
  so this account can't login
  • Loading branch information
atodorov committed Mar 19, 2020
1 parent af5c2ec commit 0056800
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,17 @@ test:
build:
./tests/check-build

.PHONY: kerberos-image
kerberos-image:
.PHONY: build-services
build-services:
docker build -t kiwitcms/kerberos -f tests/krb5/Dockerfile.kerberos tests/krb5/

.PHONY: run-kerberos
run-kerberos:
docker run -d --name krb5_kiwitcms_org kiwitcms/kerberos

.PHONY: kiwitcms-image
kiwitcms-image:
docker build -t kiwitcms/with-kerberos -f tests/krb5/Dockerfile.kiwitcms tests/krb5/

.PHONY: run-kiwitcms
run-kiwitcms:
docker run -d --name web_kiwitcms_org kiwitcms/with-kerberos
docker exec -it web_kiwitcms_org /Kiwi/manage.py migrate
# docker exec -it web_kiwitcms_org /Kiwi/manage.py createsuperuser
.PHONY: run-services
run-services:
docker-compose -f tests/krb5/docker-compose.yml up -d
docker exec -i web_kiwitcms_org /Kiwi/manage.py migrate
docker exec -i web_kiwitcms_org /Kiwi/manage.py createsuperuser --noinput --username super-root --email root@example.com
docker cp krb5_kiwitcms_org:/tmp/application.keytab .
docker cp ./application.keytab web_kiwitcms_org:/Kiwi/application.keytab
rm ./application.keytab
docker exec -u 0 -it web_kiwitcms_org /bin/bash -c 'chown 1001:root /Kiwi/application.keytab'
docker exec -u 0 -i web_kiwitcms_org /bin/bash -c 'chown 1001:root /Kiwi/application.keytab'
12 changes: 12 additions & 0 deletions tests/krb5/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '2'

services:
krb5_kiwitcms_org:
container_name: krb5_kiwitcms_org
image: kiwitcms/kerberos
restart: always

web_kiwitcms_org:
container_name: web_kiwitcms_org
image: kiwitcms/with-kerberos
restart: always

0 comments on commit 0056800

Please sign in to comment.