-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Certain steps (e.g loading sites, tokens, services) will be replaced through separate branches. Those branches will branch from this branch.
- Loading branch information
Sonny Bakker
committed
Dec 12, 2024
1 parent
259c9a6
commit bec6031
Showing
16 changed files
with
103 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# setup initial configuration using environment variables | ||
# setup initial configuration using an yaml file | ||
# Run this script from the root of the repository | ||
|
||
#set -e | ||
${SCRIPTPATH}/wait_for_db.sh | ||
set -e | ||
|
||
src/manage.py migrate | ||
src/manage.py setup_configuration --no-selftest | ||
if [[ "${RUN_SETUP_CONFIG,,}" =~ ^(true|1|yes)$ ]]; then | ||
# wait for required services | ||
/wait_for_db.sh | ||
|
||
src/manage.py migrate | ||
src/manage.py setup_configuration --yaml-file setup_configuration/data.yaml | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,28 +16,17 @@ services: | |
build: &web_build | ||
context: . | ||
environment: &web_env | ||
- DJANGO_SETTINGS_MODULE=objects.conf.docker | ||
- SECRET_KEY=${SECRET_KEY:-1(@f(-6s_u(5fd&1sg^uvu2s(c-9sapw)1era8q&)g)h@cwxxg} | ||
- IS_HTTPS=no | ||
- ALLOWED_HOSTS=* | ||
- CACHE_DEFAULT=redis:6379/0 | ||
- CACHE_AXES=redis:6379/0 | ||
- CELERY_BROKER_URL=redis://redis:6379/1 | ||
- CELERY_RESULT_BACKEND=redis://redis:6379/1 | ||
- CELERY_LOGLEVEL=DEBUG | ||
- DISABLE_2FA=${DISABLE_2FA:-yes} | ||
- SUBPATH=${SUBPATH} | ||
# setup_configuration env vars | ||
- SITES_CONFIG_ENABLE=yes | ||
- OBJECTS_DOMAIN=web:8000 | ||
- OBJECTS_ORGANIZATION=Objects | ||
- OBJECTS_OBJECTTYPES_CONFIG_ENABLE=false | ||
# - OBJECTTYPES_API_ROOT=https://objecttypes.example.com/api/v2/ | ||
- OBJECTS_OBJECTTYPES_TOKEN=some-random-string | ||
- DEMO_CONFIG_ENABLE=yes | ||
- DEMO_TOKEN=demo-random-string | ||
- DEMO_PERSON=Demo | ||
- [email protected] | ||
DJANGO_SETTINGS_MODULE: objects.conf.docker | ||
SECRET_KEY: ${SECRET_KEY:-1(@f(-6s_u(5fd&1sg^uvu2s(c-9sapw)1era8q&)g)h@cwxxg} | ||
IS_HTTPS: no | ||
ALLOWED_HOSTS: * | ||
CACHE_DEFAULT: redis:6379/0 | ||
CACHE_AXES: redis:6379/0 | ||
CELERY_BROKER_URL: redis://redis:6379/1 | ||
CELERY_RESULT_BACKEND: redis://redis:6379/1 | ||
CELERY_LOGLEVEL: DEBUG | ||
DISABLE_2FA: ${DISABLE_2FA:-yes} | ||
SUBPATH: ${SUBPATH} | ||
healthcheck: | ||
test: ["CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])"] | ||
interval: 30s | ||
|
@@ -46,7 +35,7 @@ services: | |
# This should allow for enough time for migrations to run before the max | ||
# retries have passed. This healthcheck in turn allows other containers | ||
# to wait for the database migrations. | ||
start_period: 30s | ||
start_period: 30s | ||
ports: | ||
- 8000:8000 | ||
depends_on: | ||
|
@@ -58,12 +47,17 @@ services: | |
web-init: | ||
image: maykinmedia/objects-api:latest | ||
build: *web_build | ||
environment: *web_env | ||
environment: | ||
<<: *web_env | ||
# | ||
# Django-setup-configuration | ||
RUN_SETUP_CONFIG: $RUN_SETUP_CONFIG:-true} | ||
command: /setup_configuration.sh | ||
depends_on: | ||
- db | ||
- redis | ||
volumes: *web_volumes | ||
volumes: | ||
- ./docker/setup_configuration:/app/setup_configuration | ||
|
||
celery: | ||
image: maykinmedia/objects-api:latest | ||
|
@@ -75,7 +69,7 @@ services: | |
interval: 30s | ||
timeout: 5s | ||
retries: 3 | ||
start_period: 10s | ||
start_period: 10s | ||
depends_on: | ||
web: | ||
condition: service_healthy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.