From 6cb9a7068e3fb53232e7b2fafc5efaddff1f2384 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sat, 13 Nov 2021 09:19:34 +0100 Subject: [PATCH] Revert "Docs: Inline docker-compose.yaml files in the documentation" --- .github/workflows/docs.yml | 2 +- docs/contribute.md | 2 - docs/install/docker.md | 164 +++++++++++++++++++++++++++++++++---- mkdocs.yml | 3 - 4 files changed, 150 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 260a5e3b..2a6b3588 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,5 +14,5 @@ jobs: - uses: actions/setup-python@v2 with: python-version: 3.x - - run: pip install mkdocs-material mkdocs-include-markdown-plugin + - run: pip install mkdocs-material - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/docs/contribute.md b/docs/contribute.md index 024f4fea..21c0292e 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -59,8 +59,6 @@ folder of the GitHub repository. In order to contribute to the documentation you can fork the repository and edit the markdown files in the browser. -Now install mkdocs and dependencies: `pip install mkdocs-material mkdocs-include-markdown-plugin`. - If you want to test the documentation locally run `mkdocs serve` from the project root. ## Contribute Translations diff --git a/docs/install/docker.md b/docs/install/docker.md index 8727eee0..7b96d223 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -65,11 +65,47 @@ This configuration exposes the application through an nginx web server on port 8 wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/plain/docker-compose.yml ``` -{% - include "./docker/plain/docker-compose.yml" - start="```yaml" - end="```\n" -%} +```yaml +version: "3" +services: + db_recipes: + restart: always + image: postgres:11-alpine + volumes: + - ./postgresql:/var/lib/postgresql/data + env_file: + - ./.env + + web_recipes: + image: vabene1111/recipes + restart: always + env_file: + - ./.env + volumes: + - staticfiles:/opt/recipes/staticfiles + - nginx_config:/opt/recipes/nginx/conf.d + - ./mediafiles:/opt/recipes/mediafiles + depends_on: + - db_recipes + + nginx_recipes: + image: nginx:mainline-alpine + restart: always + ports: + - 80:80 + env_file: + - ./.env + depends_on: + - web_recipes + volumes: + - nginx_config:/etc/nginx/conf.d:ro + - staticfiles:/static + - ./mediafiles:/media + +volumes: + nginx_config: + staticfiles: +``` ### Reverse Proxy @@ -87,11 +123,62 @@ If you use traefik, this configuration is the one for you. wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/traefik-nginx/docker-compose.yml ``` -{% - include "./docker/traefik-nginx/docker-compose.yml" - start="```yaml" - end="```\n" -%} +```yaml +version: "3" +services: + db_recipes: + restart: always + image: postgres:11-alpine + volumes: + - ./postgresql:/var/lib/postgresql/data + env_file: + - ./.env + networks: + - default + + web_recipes: + image: vabene1111/recipes + restart: always + env_file: + - ./.env + volumes: + - staticfiles:/opt/recipes/staticfiles + - nginx_config:/opt/recipes/nginx/conf.d + - ./mediafiles:/opt/recipes/mediafiles + depends_on: + - db_recipes + networks: + - default + + nginx_recipes: + image: nginx:mainline-alpine + restart: always + env_file: + - ./.env + volumes: + - nginx_config:/etc/nginx/conf.d:ro + - staticfiles:/static + - ./mediafiles:/media + labels: # traefik example labels + - "traefik.enable=true" + - "traefik.http.routers.recipes.rule=Host(`recipes.mydomain.com`, `recipes.myotherdomain.com`)" + - "traefik.http.routers.recipes.entrypoints=web_secure" # your https endpoint + - "traefik.http.routers.recipes.tls.certresolver=le_resolver" # your cert resolver + depends_on: + - web_recipes + networks: + - default + - traefik + +networks: + default: + traefik: # This is you external traefik network + external: true + +volumes: + nginx_config: + staticfiles: +``` #### nginx-proxy @@ -111,11 +198,58 @@ LETSENCRYPT_EMAIL= wget https://raw.githubusercontent.com/vabene1111/recipes/develop/docs/install/docker/nginx-proxy/docker-compose.yml ``` -{% - include "./docker/nginx-proxy/docker-compose.yml" - start="```yaml" - end="```\n" -%} +```yaml +version: "3" +services: + db_recipes: + restart: always + image: postgres:11-alpine + volumes: + - ./postgresql:/var/lib/postgresql/data + env_file: + - ./.env + networks: + - default + + web_recipes: + image: vabene1111/recipes + restart: always + env_file: + - ./.env + volumes: + - staticfiles:/opt/recipes/staticfiles + - nginx_config:/opt/recipes/nginx/conf.d + - ./mediafiles:/opt/recipes/mediafiles + depends_on: + - db_recipes + networks: + - default + + nginx_recipes: + image: nginx:mainline-alpine + restart: always + env_file: + - ./.env + depends_on: + - web_recipes + volumes: + - nginx_config:/etc/nginx/conf.d:ro + - staticfiles:/static + - ./mediafiles:/media + networks: + - default + - nginx-proxy + +networks: + default: + nginx-proxy: + external: + name: nginx-proxy + +volumes: + nginx_config: + staticfiles: +``` ## Additional Information diff --git a/mkdocs.yml b/mkdocs.yml index ed6de84e..b511bd9e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,9 +21,6 @@ markdown_extensions: - pymdownx.highlight - pymdownx.superfences -plugins: - - include-markdown - nav: - Home: 'index.md' - Installation: