diff --git a/.github/workflows/quick-start.yml b/.github/workflows/quick-start.yml index e3cf9353..40aa0baa 100644 --- a/.github/workflows/quick-start.yml +++ b/.github/workflows/quick-start.yml @@ -6,19 +6,15 @@ jobs: run: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - name: Download docker-compose file - run: wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml - - name: Overwrite the docker-compose file to get the "current" one - run: cp docker-compose-quickstart.yml docker-compose-qs.yml + # todo replace branch name with master after the change is merge + run: wget https://raw.githubusercontent.com/maykinmedia/objects-api/feature/merge-docker-composes/docker-compose.yml - name: Start docker containers - run: docker-compose -f docker-compose-qs.yml up -d - - name: Wait until DB container starts - run: sleep 10 + run: docker compose up -d --no-build - name: Load fixtures - run: docker-compose -f docker-compose-qs.yml exec -T web src/manage.py loaddata demodata + run: docker compose exec -T web src/manage.py loaddata demodata - name: Create superuser - run: docker-compose -f docker-compose-qs.yml exec -T web src/manage.py createsuperuser --username admin --email admin@admin.nl --no-input + run: docker compose exec -T web src/manage.py createsuperuser --username admin --email admin@admin.nl --no-input - name: Check main page run: | curl_status=$(curl -w '%{http_code}' -o /dev/null -s http://localhost:8000/) diff --git a/README.NL.rst b/README.NL.rst index 37cc3895..15673cd2 100644 --- a/README.NL.rst +++ b/README.NL.rst @@ -94,10 +94,10 @@ Quickstart .. code:: bash - $ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose.yml - $ docker-compose -f docker-compose-qs.yml up -d - $ docker-compose exec web src/manage.py loaddata demodata - $ docker-compose exec web src/manage.py createsuperuser + wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose.yml + docker compose up -d --no-build + docker compose exec web src/manage.py loaddata demodata + docker compose exec web src/manage.py createsuperuser 2. In de browser, navigeer naar ``http://localhost:8000/`` om de admin en de API te benaderen. diff --git a/README.rst b/README.rst index d29c697d..22fa73bb 100644 --- a/README.rst +++ b/README.rst @@ -92,10 +92,10 @@ Quickstart .. code:: bash - $ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml - $ docker-compose -f docker-compose-qs.yml up -d - $ docker-compose exec web src/manage.py loaddata demodata - $ docker-compose exec web src/manage.py createsuperuser + wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose.yml + docker compose up -d --no-build + docker compose exec web src/manage.py loaddata demodata + docker compose exec web src/manage.py createsuperuser 2. In the browser, navigate to ``http://localhost:8000/`` to access the admin and the API. diff --git a/docker-compose-quickstart.yml b/docker-compose-quickstart.yml deleted file mode 100644 index 059ef151..00000000 --- a/docker-compose-quickstart.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: '3' - -services: - db: - image: postgis/postgis:12-2.5 - environment: - - POSTGRES_USER=${DB_USER:-objects} - - POSTGRES_PASSWORD=${DB_PASSWORD:-objects} - - web: - image: maykinmedia/objects-api:latest - environment: - - DJANGO_SETTINGS_MODULE=objects.conf.docker - - SECRET_KEY=${SECRET_KEY:-1(@f(-6s_u(5fd&1sg^uvu2s(c-9sapw)1era8q&)g)h@cwxxg} - - ALLOWED_HOSTS=* - ports: - - 8000:8000 - depends_on: - - db diff --git a/docker-compose.yml b/docker-compose.yml index 16a6df45..539d6d9e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: db: # NOTE: No persistance storage configured. @@ -14,14 +12,12 @@ services: command: ["redis-server", "--appendonly", "yes"] web: + image: maykinmedia/objects-api:latest 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} - - OBJECTS_SUPERUSER_USERNAME=admin - - OBJECTS_SUPERUSER_PASSWORD=admin - - OBJECTS_SUPERUSER_EMAIL=admin@localhost - IS_HTTPS=no - ALLOWED_HOSTS=* - CACHE_DEFAULT=redis:6379/0 @@ -48,6 +44,7 @@ services: - media:/app/media # Shared media volume to get access to saved OAS files web-init: + image: maykinmedia/objects-api:latest build: *web_build environment: *web_env command: /setup_configuration.sh @@ -57,6 +54,7 @@ services: volumes: *web_volumes celery: + image: maykinmedia/objects-api:latest build: *web_build environment: *web_env command: /celery_worker.sh @@ -66,6 +64,7 @@ services: volumes: *web_volumes celery-flower: + image: maykinmedia/objects-api:latest build: *web_build environment: *web_env command: /celery_flower.sh diff --git a/docs/installation/quickstart.rst b/docs/installation/quickstart.rst index d647863b..de37b1ea 100644 --- a/docs/installation/quickstart.rst +++ b/docs/installation/quickstart.rst @@ -3,7 +3,7 @@ Quickstart ========== -A simple ``docker-compose-quickstart.yml`` file is available to get the APIs +A simple ``docker-compose.yml`` file is available to get the APIs up and running in minutes. This file has some convenience settings to get started quickly and these should never be used for anything besides testing: @@ -31,31 +31,31 @@ Objecttypes API .. code:: shell - $ wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml + $ wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose.yml .. tab:: Windows Powershell 3 .. code:: shell - PS> wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml + PS> wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/master/docker-compose.yml 3. Start the Docker containers: .. code:: shell - $ docker-compose -f docker-compose-qs.yml up -d + $ docker compose up -d --no-build 4. Import a demo set of objecttypes: .. code:: shell - $ docker-compose exec web src/manage.py loaddata demodata + $ docker compose exec web src/manage.py loaddata demodata 5. Create a superuser .. code:: shell - $ docker-compose exec web src/manage.py createsuperuser + $ docker compose exec web src/manage.py createsuperuser Objects API @@ -76,32 +76,32 @@ Objects API .. code:: shell - $ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml + $ wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose.yml .. tab:: Windows Powershell 3 .. code:: shell - PS> wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose-quickstart.yml -O docker-compose-qs.yml + PS> wget https://raw.githubusercontent.com/maykinmedia/objects-api/master/docker-compose.yml 3. Start the Docker containers: .. code:: shell - $ docker-compose -f docker-compose-qs.yml up -d + $ docker compose -f docker-compose-qs.yml up -d --no-build 4. Import a demo set of objects (linking to the demo objecttypes): .. code:: shell - $ docker-compose exec web src/manage.py loaddata demodata + $ docker compose exec web src/manage.py loaddata demodata 5. Create a superuser .. code:: shell - $ docker-compose exec web src/manage.py createsuperuser + $ docker compose exec web src/manage.py createsuperuser 6. Retrieve an object via the Objects API in your webbrowser: