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