Compare commits
No commits in common. "f68e1638fc2ebf2d0e6643c4f0086cd6dc0dc270" and "f84539f6b7c6fc5842ee957cb089aaa348a22496" have entirely different histories.
f68e1638fc
...
f84539f6b7
14
.env.example
14
.env.example
|
@ -1,12 +1,6 @@
|
||||||
# ORCHESTRA
|
ORCHESTRA_SECRET_KEY=
|
||||||
####
|
MUSICIAN_SECRET_KEY=
|
||||||
|
|
||||||
#ORCHESTRA_SECRET_KEY='uncomment-it-and-fill-this'
|
|
||||||
|
|
||||||
# MUSICIAN
|
|
||||||
####
|
|
||||||
|
|
||||||
#MUSICIAN_SECRET_KEY='uncomment-it-and-fill-this'
|
|
||||||
# specially useful if you want to deploy in a specific domain
|
# specially useful if you want to deploy in a specific domain
|
||||||
#MUSICIAN_API_BASE_URL='https://orchestra.example.org'
|
#MUSICIAN_API_BASE_URL=https://orchestra.example.org
|
||||||
#MUSICIAN_ALLOWED_HOSTS='musician.example.org'
|
#ALLOWED_HOSTS=musician.example.org
|
||||||
|
|
23
Makefile
23
Makefile
|
@ -18,35 +18,30 @@ orchestra_image := ${project}/orchestra:${orchestra_tag}
|
||||||
|
|
||||||
musician_branch := `git -C django-musician branch --show-current`
|
musician_branch := `git -C django-musician branch --show-current`
|
||||||
musician_commit := `git -C django-musician log -1 --format=%h`
|
musician_commit := `git -C django-musician log -1 --format=%h`
|
||||||
musician_tag := ${musician_branch}__${musician_commit}
|
musician_tag := ${orchestra_branch}__${musician_commit}
|
||||||
musician_image := ${project}/musician:${musician_tag}
|
musician_image := ${project}/musician:${musician_tag}
|
||||||
|
|
||||||
####
|
####
|
||||||
# idhub image tag
|
# idhub image tag
|
||||||
####
|
####
|
||||||
|
|
||||||
idhub_branch := `git -C IdHub branch --show-current`
|
idhub_branch := `git -C django-idhub branch --show-current`
|
||||||
idhub_commit := `git -C IdHub log -1 --format=%h`
|
idhub_commit := `git -C django-idhub log -1 --format=%h`
|
||||||
idhub_tag := ${idhub_branch}__${idhub_commit}
|
idhub_tag := ${orchestra_branch}__${idhub_commit}
|
||||||
idhub_image := ${project}/idhub:${idhub_tag}
|
idhub_image := ${project}/idhub:${idhub_tag}
|
||||||
|
|
||||||
docker_build:
|
docker_build:
|
||||||
#docker build -f docker/orchestra.Dockerfile -t ${orchestra_image} .
|
docker build -f docker/orchestra.Dockerfile -t ${orchestra_image} .
|
||||||
#docker build -f docker/musician.Dockerfile -t ${musician_image} .
|
docker build -f docker/musician.Dockerfile -t ${musician_image} .
|
||||||
docker build -f docker/idhub.Dockerfile -t ${idhub_image} .
|
|
||||||
@printf "\n##########################\n"
|
|
||||||
@printf "\nimage: ${orchestra_image}\n"
|
|
||||||
@printf "\nimage: ${musician_image}\n"
|
|
||||||
@printf "\nimage: ${idhub_image}\n"
|
|
||||||
@printf "\ndocker images built\n"
|
|
||||||
@printf "\n##########################\n\n"
|
|
||||||
|
|
||||||
docker_publish:
|
docker_publish:
|
||||||
docker push ${orchestra_image}
|
docker push ${orchestra_image}
|
||||||
docker push ${musician_image}
|
docker push ${musician_image}
|
||||||
docker push ${idhub_image}
|
|
||||||
|
|
||||||
.PHONY: docker
|
.PHONY: docker
|
||||||
docker:
|
docker:
|
||||||
$(MAKE) docker_build
|
$(MAKE) docker_build
|
||||||
$(MAKE) docker_publish
|
$(MAKE) docker_publish
|
||||||
|
@printf "\nimage: ${orchestra_image}\n"
|
||||||
|
@printf "\nimage: ${musician_image}\n"
|
||||||
|
@printf "\ndocker images built and published\n"
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
docker files and integrations
|
docker files and integrations
|
||||||
|
|
||||||
# idhub
|
|
||||||
|
|
||||||
use script `./idhub_build.sh` to rebuild it locally
|
|
||||||
|
|
||||||
TODO: incorporate to general docker compose
|
|
||||||
|
|
||||||
# deploy everything in localhost
|
# deploy everything in localhost
|
||||||
|
|
||||||
note: right now the same applies for localhost and reachable deployments
|
note: right now the same applies for localhost and reachable deployments
|
||||||
|
|
|
@ -5,7 +5,7 @@ services:
|
||||||
init: true
|
init: true
|
||||||
image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/orchestra:sso__533d749
|
image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/orchestra:sso__533d749
|
||||||
environment:
|
environment:
|
||||||
- SECRET_KEY=${ORCHESTRA_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd}
|
- SECRET_KEY=${ORCHESTRA_SECRET_KEY:-123456}
|
||||||
ports:
|
ports:
|
||||||
- "9080:9080"
|
- "9080:9080"
|
||||||
# TODO configure volumes
|
# TODO configure volumes
|
||||||
|
@ -18,9 +18,9 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
- SECRET_KEY=${MUSICIAN_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd}
|
- SECRET_KEY=${MUSICIAN_SECRET_KEY:-123456}
|
||||||
- API_BASE_URL=${MUSICIAN_API_BASE_URL:-http://nginx-orchestra-api:3000}
|
- API_BASE_URL=${MUSICIAN_API_BASE_URL:-http://nginx-orchestra-api:3000}
|
||||||
- ALLOWED_HOSTS=${MUSICIAN_ALLOWED_HOSTS:-*}
|
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
|
||||||
# TODO configure volumes
|
# TODO configure volumes
|
||||||
#volumes:
|
#volumes:
|
||||||
# - .:/home
|
# - .:/home
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
version: "3.9"
|
|
||||||
services:
|
|
||||||
|
|
||||||
idhub:
|
|
||||||
init: true
|
|
||||||
image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/idhub:main__233d8df
|
|
||||||
environment:
|
|
||||||
- SECRET_KEY=${IDHUB_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd}
|
|
||||||
- ALLOWED_HOSTS=${IDHUB_ALLOWED_HOSTS:-*}
|
|
||||||
- STATIC_ROOT=${IDHUB_STATIC_ROOT:-/static/}
|
|
||||||
- MEDIA_ROOT=${IDHUB_MEDIA_ROOT:-/media/}
|
|
||||||
- PORT=${IDHUB_PORT:-7000}
|
|
||||||
- DJANGO_SUPERUSER_USERNAME=${IDHUB_USER}
|
|
||||||
- DJANGO_SUPERUSER_PASSWORD=${IDHUB_PASSWD}
|
|
||||||
- DJANGO_SUPERUSER_EMAIL=${IDHUB_EMAIL}
|
|
||||||
- DEPLOYMENT=${IDHUB_DEPLOYMENT}
|
|
||||||
ports:
|
|
||||||
- 7000:7000
|
|
|
@ -1,17 +0,0 @@
|
||||||
FROM debian:bullseye-slim
|
|
||||||
|
|
||||||
RUN apt update && apt-get install -y \
|
|
||||||
python3-minimal \
|
|
||||||
python3-pip \
|
|
||||||
python3-dev \
|
|
||||||
python-is-python3
|
|
||||||
|
|
||||||
WORKDIR /home
|
|
||||||
|
|
||||||
RUN python3 -m pip install --upgrade pip
|
|
||||||
|
|
||||||
COPY IdHub .
|
|
||||||
RUN pip install -r requirements.txt
|
|
||||||
|
|
||||||
COPY docker/idhub.entrypoint.sh .
|
|
||||||
ENTRYPOINT sh ./idhub.entrypoint.sh
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -u
|
|
||||||
set -x
|
|
||||||
|
|
||||||
main() {
|
|
||||||
# go to the same path as the script
|
|
||||||
cd "$(dirname ${0})"
|
|
||||||
|
|
||||||
# enable dev flags when DEVELOPMENT deployment
|
|
||||||
if [ "${DEPLOYMENT}" = 'DEVELOPMENT' ]; then
|
|
||||||
export DEBUG=True
|
|
||||||
export DEVELOPMENT=True
|
|
||||||
fi
|
|
||||||
|
|
||||||
# move the migrate thing in docker entrypoint
|
|
||||||
# inspired by https://medium.com/analytics-vidhya/django-with-docker-and-docker-compose-python-part-2-8415976470cc
|
|
||||||
./manage.py migrate
|
|
||||||
#./manage.py collectstatic
|
|
||||||
|
|
||||||
printf "creating superuser \n user: ${DJANGO_SUPERUSER_USERNAME}\n password: ${DJANGO_SUPERUSER_PASSWORD}\n email: ${DJANGO_SUPERUSER_EMAIL}\n" >&2
|
|
||||||
# thanks https://stackoverflow.com/questions/6244382/how-to-automate-createsuperuser-on-django/59467533#59467533
|
|
||||||
./manage.py createsuperuser --no-input
|
|
||||||
|
|
||||||
./manage.py runserver 0.0.0.0:${PORT}
|
|
||||||
}
|
|
||||||
|
|
||||||
main "${@}"
|
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -u
|
|
||||||
# DEBUG
|
|
||||||
set -x
|
|
||||||
|
|
||||||
main() {
|
|
||||||
idhub_dc_f='docker-compose_idhub-temp.yml'
|
|
||||||
docker compose -f ${idhub_dc_f} down -v \
|
|
||||||
&& make docker_build \
|
|
||||||
&& docker compose -f ${idhub_dc_f} up
|
|
||||||
}
|
|
||||||
|
|
||||||
main "${@}"
|
|
Reference in a new issue