Skip to content

Commit

Permalink
[maykinmedia/open-api-framework#100] Add quick-start.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Feb 4, 2025
1 parent 66aea4f commit 3535d8e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/quick-start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: quick-start

on:
push:
branches:
- master
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
open-api-workflow-quick-start:
uses: maykinmedia/open-api-workflows/.github/workflows/quick-start.yml@feature/add-quick-start
with:
superuser: 'open-admin'
13 changes: 9 additions & 4 deletions bin/setup_configuration.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/bin/bash

# setup initial configuration using environment variables
# setup initial configuration using a yaml file
# Run this script from the root of the repository

#set -e
set -e

src/manage.py migrate
src/manage.py setup_configuration --yaml-file setup_configuration/data.yaml
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
38 changes: 21 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ services:
web:
build: .
environment: &app-env
- DJANGO_SETTINGS_MODULE=nrc.conf.docker
- SECRET_KEY=${SECRET_KEY:-\(,gc7VE(#CO<zCR3e(lRtOsw5q+U2DpG5o\X#P4PVRm*=u|E%}
- IS_HTTPS=no
- ALLOWED_HOSTS=*
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/1
- RABBITMQ_HOST=rabbitmq
- PUBLISH_BROKER_URL=amqp://guest:guest@rabbitmq:5672/%2F
- CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672//
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_LOGLEVEL=DEBUG
- CELERY_WORKER_CONCURRENCY=${CELERY_WORKER_CONCURRENCY:-4}
- SUBPATH=${SUBPATH:-/}
- OPENNOTIFICATIES_SUPERUSER_USERNAME=admin
- OPENNOTIFICATIES_SUPERUSER_EMAIL=admin@localhost
- DJANGO_SUPERUSER_PASSWORD=admin
DJANGO_SETTINGS_MODULE: nrc.conf.docker
SECRET_KEY: ${SECRET_KEY:-\(,gc7VE(#CO<zCR3e(lRtOsw5q+U2DpG5o\X#P4PVRm*=u|E%}
IS_HTTPS: no
ALLOWED_HOSTS: '*'
CACHE_DEFAULT: redis:6379/0
CACHE_AXES: redis:6379/1
RABBITMQ_HOST: rabbitmq
PUBLISH_BROKER_URL: amqp://guest:guest@rabbitmq:5672/%2F
CELERY_BROKER_URL: amqp://guest:guest@rabbitmq:5672//
CELERY_RESULT_BACKEND: redis://redis:6379/1
CELERY_LOGLEVEL: DEBUG
CELERY_WORKER_CONCURRENCY: ${CELERY_WORKER_CONCURRENCY:-4}
SUBPATH: ${SUBPATH:-/}
OPENNOTIFICATIES_SUPERUSER_USERNAME: admin
OPENNOTIFICATIES_SUPERUSER_EMAIL: admin@localhost
DJANGO_SUPERUSER_PASSWORD: admin
healthcheck:
test: ["CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])"]
interval: 30s
Expand All @@ -56,7 +56,11 @@ services:

web-init:
build: .
environment: *app-env
environment:
<<: *app-env
#
# Django-setup-configuration
RUN_SETUP_CONFIG: ${RUN_SETUP_CONFIG:-true}
command: /setup_configuration.sh
depends_on:
- db
Expand Down

0 comments on commit 3535d8e

Please sign in to comment.