Compare commits

..

No commits in common. "f68e1638fc2ebf2d0e6643c4f0086cd6dc0dc270" and "f84539f6b7c6fc5842ee957cb089aaa348a22496" have entirely different histories.

8 changed files with 16 additions and 112 deletions

View file

@ -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
#MUSICIAN_API_BASE_URL='https://orchestra.example.org'
#MUSICIAN_ALLOWED_HOSTS='musician.example.org'
#MUSICIAN_API_BASE_URL=https://orchestra.example.org
#ALLOWED_HOSTS=musician.example.org

View file

@ -18,35 +18,30 @@ orchestra_image := ${project}/orchestra:${orchestra_tag}
musician_branch := `git -C django-musician branch --show-current`
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}
####
# idhub image tag
####
idhub_branch := `git -C IdHub branch --show-current`
idhub_commit := `git -C IdHub log -1 --format=%h`
idhub_tag := ${idhub_branch}__${idhub_commit}
idhub_branch := `git -C django-idhub branch --show-current`
idhub_commit := `git -C django-idhub log -1 --format=%h`
idhub_tag := ${orchestra_branch}__${idhub_commit}
idhub_image := ${project}/idhub:${idhub_tag}
docker_build:
#docker build -f docker/orchestra.Dockerfile -t ${orchestra_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 build -f docker/orchestra.Dockerfile -t ${orchestra_image} .
docker build -f docker/musician.Dockerfile -t ${musician_image} .
docker_publish:
docker push ${orchestra_image}
docker push ${musician_image}
docker push ${idhub_image}
.PHONY: docker
docker:
$(MAKE) docker_build
$(MAKE) docker_publish
@printf "\nimage: ${orchestra_image}\n"
@printf "\nimage: ${musician_image}\n"
@printf "\ndocker images built and published\n"

View file

@ -1,11 +1,5 @@
docker files and integrations
# idhub
use script `./idhub_build.sh` to rebuild it locally
TODO: incorporate to general docker compose
# deploy everything in localhost
note: right now the same applies for localhost and reachable deployments

View file

@ -5,7 +5,7 @@ services:
init: true
image: dkr-dsg.ac.upc.edu/trustchain-oc1-orchestral/orchestra:sso__533d749
environment:
- SECRET_KEY=${ORCHESTRA_SECRET_KEY:-publicsecretisnotsecureVtmKBfxpVV47PpBCF2Nzz2H6qnbd}
- SECRET_KEY=${ORCHESTRA_SECRET_KEY:-123456}
ports:
- "9080:9080"
# TODO configure volumes
@ -18,9 +18,9 @@ services:
ports:
- "8080:8080"
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}
- ALLOWED_HOSTS=${MUSICIAN_ALLOWED_HOSTS:-*}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
# TODO configure volumes
#volumes:
# - .:/home

View file

@ -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

View file

@ -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

View file

@ -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 "${@}"

View file

@ -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 "${@}"