From 58f1aee660d6fc24b74012bd8b4897a48690381a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 27 Feb 2023 16:45:06 +0100 Subject: [PATCH 1/4] Remove Apple M1 Docker overrides and reduce information about its usage in the readmes --- CONTRIBUTING.md | 25 ++----------- backend/README.md | 12 +++++-- deployment/DOCKER_MORE_CLOSELY.md | 28 ++------------- .../docker-compose.apple-m1.override.yml | 36 ------------------- docker-compose.apple-m1.override.yml | 34 ------------------ 5 files changed, 14 insertions(+), 121 deletions(-) delete mode 100644 deployment/docker-compose.apple-m1.override.yml delete mode 100644 docker-compose.apple-m1.override.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83a63b36a..b2c8a7dbb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -174,34 +174,15 @@ Please copy and paste the following quotes for the languages: #### Environment Variable For Apple M1 Platform -To set the Docker platform environment variable in your terminal tab, run: +To set the following environment variable seems not be needed anymore, probably because Docker knows in its newest version on which CPU it runs and sets that to default. +But we leave this command here to keep the knowledge about how to set the platform: ```bash # set env variable for your shell $ export DOCKER_DEFAULT_PLATFORM=linux/amd64 ``` -#### Docker Compose Override File For Apple M1 Platform - -For Docker compose `up` or `build` commands, you can use our Apple M1 override file that specifies the M1 platform: - -```bash -# in main folder - -# for development -$ docker compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.apple-m1.override.yml up -# only once: init admin user and create indexes and contraints in Neo4j database -$ docker compose exec backend yarn prod:migrate init -# clean db -$ docker compose exec backend yarn db:reset -# seed db -$ docker compose exec backend yarn db:seed - -# for production -$ docker compose -f docker-compose.yml -f docker-compose.apple-m1.override.yml up -# only once: init admin user and create indexes and contraints in Neo4j database -$ docker compose exec backend /bin/sh -c "yarn prod:migrate init" -``` +Or alternatively use a `YAML` docker compose overwrite file with `platform: linux/amd64`. ### Analyzing Docker Builds diff --git a/backend/README.md b/backend/README.md index 4ce74dc40..03724ce54 100644 --- a/backend/README.md +++ b/backend/README.md @@ -79,9 +79,9 @@ More details about our GraphQL playground and how to use it with ocelot.social c ![GraphQL Playground](../.gitbook/assets/graphql-playground.png) -### Database Indices and Constraints +### Database Indexes and Constraints -Database indices and constraints need to be created when the database and the +Database indexes and constraints need to be created when the database and the backend is running: {% tabs %} @@ -90,6 +90,12 @@ backend is running: ```bash # in main folder while docker-compose is running $ docker exec backend yarn run db:migrate init + +# only once: init admin user and create indexes and constraints in Neo4j database +# for development +$ docker compose exec backend yarn prod:migrate init +# in production mode use command +$ docker compose exec backend /bin/sh -c "yarn prod:migrate init" ``` {% endtab %} @@ -126,7 +132,7 @@ To reset the database run: $ docker exec backend yarn run db:reset # you could also wipe out your neo4j database and delete all volumes with: $ docker-compose down -v -# if container is not running, run this command to set up your database indeces and contstraints +# if container is not running, run this command to set up your database indexes and constraints $ docker exec backend yarn run db:migrate init ``` diff --git a/deployment/DOCKER_MORE_CLOSELY.md b/deployment/DOCKER_MORE_CLOSELY.md index 113e3a4da..2bf213a33 100644 --- a/deployment/DOCKER_MORE_CLOSELY.md +++ b/deployment/DOCKER_MORE_CLOSELY.md @@ -2,32 +2,8 @@ ## Apple M1 Platform -***Attention:** For using Docker commands in Apple M1 environments!* - -```bash -# set env variable for your shell -$ export DOCKER_DEFAULT_PLATFORM=linux/amd64 -``` - -For even more informations, see [Docker More Closely](#docker-more-closely) - -### Docker Compose Override File For Apple M1 Platform - -For Docker compose `up` or `build` commands, you can use our Apple M1 override file that specifies the M1 platform: - -```bash -# in main folder - -# for production -$ docker compose -f docker-compose.yml -f docker-compose.apple-m1.override.yml up - -# for production testing Docker images from DockerHub -$ docker compose -f docker-compose.ocelotsocial-branded.yml -f docker-compose.apple-m1.override.yml up - -# only once: init admin user and create indexes and contraints in Neo4j database -$ docker compose exec backend /bin/sh -c "yarn prod:migrate init" -``` +To get more information about the Apple M1 platform you find our documentation in our main code, [here](/CONTRIBUTING.md#docker-more-closely). ## Docker More Closely In Main Code -To get more informations about the Apple M1 platform and to analyze the Docker builds etc. you find our documentation in our main code, [here](https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/DOCKER_MORE_CLOSELY.md). +To get more information about how to analyze the Docker builds etc. you find our documentation in our main code, [here](/CONTRIBUTING.md#docker-more-closely). diff --git a/deployment/docker-compose.apple-m1.override.yml b/deployment/docker-compose.apple-m1.override.yml deleted file mode 100644 index 80344e49f..000000000 --- a/deployment/docker-compose.apple-m1.override.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This docker-compose file is just here for testing - -version: "3.4" - -services: - - ######################################################## - # WEBAPP ############################################### - ######################################################## - webapp: - platform: linux/amd64 - - ######################################################## - # BACKEND ############################################## - ######################################################## - backend: - platform: linux/amd64 - - ######################################################## - # MAINTENANCE ########################################## - ######################################################## - maintenance: - platform: linux/amd64 - - ######################################################## - # NEO4J ################################################ - ######################################################## - neo4j: - platform: linux/amd64 - - ######################################################## - # MAILSERVER TO FAKE SMTP ############################## - ######################################################## - # commented out, because otherwise override of production would error. and it seems unnecessary - # mailserver: - # platform: linux/amd64 diff --git a/docker-compose.apple-m1.override.yml b/docker-compose.apple-m1.override.yml deleted file mode 100644 index cbb041c51..000000000 --- a/docker-compose.apple-m1.override.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: "3.4" - -services: - - ######################################################## - # WEBAPP ############################################### - ######################################################## - webapp: - platform: linux/amd64 - - ######################################################## - # BACKEND ############################################## - ######################################################## - backend: - platform: linux/amd64 - - ######################################################## - # MAINTENANCE ########################################## - ######################################################## - maintenance: - platform: linux/amd64 - - ######################################################## - # NEO4J ################################################ - ######################################################## - neo4j: - platform: linux/amd64 - - ######################################################## - # MAILSERVER TO FAKE SMTP ############################## - ######################################################## - # commented out, because otherwise override of production would error. and it seems unnecessary - # mailserver: - # platform: linux/amd64 From 1b27c17779039e9167ae6d354ff30237c1b6ef17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 6 Mar 2023 18:30:56 +0100 Subject: [PATCH 2/4] Remove `deployment/DOCKER_MORE_CLOSELY.md` --- deployment/DOCKER_MORE_CLOSELY.md | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 deployment/DOCKER_MORE_CLOSELY.md diff --git a/deployment/DOCKER_MORE_CLOSELY.md b/deployment/DOCKER_MORE_CLOSELY.md deleted file mode 100644 index 2bf213a33..000000000 --- a/deployment/DOCKER_MORE_CLOSELY.md +++ /dev/null @@ -1,9 +0,0 @@ -# Docker - -## Apple M1 Platform - -To get more information about the Apple M1 platform you find our documentation in our main code, [here](/CONTRIBUTING.md#docker-more-closely). - -## Docker More Closely In Main Code - -To get more information about how to analyze the Docker builds etc. you find our documentation in our main code, [here](/CONTRIBUTING.md#docker-more-closely). From cd498a17f0cfa3af6183c055a53b3c1f4b1f1ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 6 Mar 2023 18:31:56 +0100 Subject: [PATCH 3/4] Replace docu text by Ulf's suggestion Co-Authored-By: Ulf Gebhardt --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b2c8a7dbb..a677f39bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -175,7 +175,7 @@ Please copy and paste the following quotes for the languages: #### Environment Variable For Apple M1 Platform To set the following environment variable seems not be needed anymore, probably because Docker knows in its newest version on which CPU it runs and sets that to default. -But we leave this command here to keep the knowledge about how to set the platform: +If you encounter trouble building the docker containers on an Apple M1 chip you can try to explicitly define the target platform docker builds and pulls images for: ```bash # set env variable for your shell From fa7927a379ed8705ffecd313fb27c45f635bf60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 6 Mar 2023 18:34:27 +0100 Subject: [PATCH 4/4] Replace docu text by Ulf's suggestion Co-Authored-By: Ulf Gebhardt --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a677f39bb..650785331 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -174,7 +174,6 @@ Please copy and paste the following quotes for the languages: #### Environment Variable For Apple M1 Platform -To set the following environment variable seems not be needed anymore, probably because Docker knows in its newest version on which CPU it runs and sets that to default. If you encounter trouble building the docker containers on an Apple M1 chip you can try to explicitly define the target platform docker builds and pulls images for: ```bash