diff --git a/.gitignore b/.gitignore index ceb1582c..8ecc284a 100644 --- a/.gitignore +++ b/.gitignore @@ -77,22 +77,4 @@ mediafiles/ staticfiles/ postgresql/ -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml diff --git a/.idea/recipes.iml b/.idea/recipes.iml new file mode 100644 index 00000000..23bc88ff --- /dev/null +++ b/.idea/recipes.iml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 32c0c653..cda1b516 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Recipes ![Continous Integration](https://github.com/vabene1111/recipes/workflows/Continous%20Integration/badge.svg?branch=develop) Recipes is a Django application to manage, tag and search recipes using either built in models or external storage providers hosting PDF's, Images or other files. -![Preview](preview.png) +![Preview](docs/preview.png) ### Features diff --git a/docs/docker/nginx-proxy/docker-compose.yml b/docs/docker/nginx-proxy/docker-compose.yml new file mode 100644 index 00000000..e1c0e011 --- /dev/null +++ b/docs/docker/nginx-proxy/docker-compose.yml @@ -0,0 +1,43 @@ +version: "3" +services: + db_recipes: + restart: always + image: "postgres:11-alpine" + volumes: + - ./postgresql:/var/lib/postgresql/data + env_file: + - ./.env + networks: + - default + + web_recipes: + build: . + restart: always + env_file: + - ./.env + command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi" + volumes: + - .:/Recipes + depends_on: + - db_recipes + networks: + - default + + nginx_recipes: + image: "nginx" + restart: always + env_file: + - ./.env + volumes: + - ./nginx/conf.d:/etc/nginx/conf.d + - ./staticfiles:/static + - ./mediafiles:/media + networks: + - default + - nginx-proxy + +networks: + default: + nginx-proxy: + external: + name: nginx-proxy diff --git a/docs/docker/plain/docker-compose.yml b/docs/docker/plain/docker-compose.yml new file mode 100644 index 00000000..30f32c48 --- /dev/null +++ b/docs/docker/plain/docker-compose.yml @@ -0,0 +1,40 @@ +version: "3" +services: + db_recipes: + restart: always + image: "postgres:11-alpine" + volumes: + - ./postgresql:/var/lib/postgresql/data + env_file: + - ./.env + networks: + - default + + web_recipes: + build: . + restart: always + env_file: + - ./.env + command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi" + volumes: + - .:/Recipes + depends_on: + - db_recipes + networks: + - default + + nginx_recipes: + image: "nginx" + restart: always + env_file: + - ./.env + volumes: + - ./nginx/conf.d:/etc/nginx/conf.d + - ./staticfiles:/static + - ./mediafiles:/media + ports: + - 80:80 + networks: + - default + depends_on: + - web_recipes \ No newline at end of file diff --git a/docs/docker/traefik/README.md b/docs/docker/traefik/README.md new file mode 100644 index 00000000..7ebb14e3 --- /dev/null +++ b/docs/docker/traefik/README.md @@ -0,0 +1,60 @@ +Please refer to the traefik documentation on how to setup a docker service in traefik. Since treafik can be a little +confusing at times, the following are examples of my traefik configuration. + + +You need to create a network called `traefik` using `docker network create traefik`. +## docker-compose.yml + +``` +version: "3.3" + +services: + + traefik: + image: "traefik:v2.1" + container_name: "traefik" + ports: + - "443:443" + - "80:80" + - "8080:8080" + volumes: + - "./letsencrypt:/letsencrypt" + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "./config:/etc/traefik/" + + +networks: + default: + external: + name: traefik +``` + +## traefik.toml +Place this in a directory called `config` as this is mounted into the traefik container (see docer compose). +**Change the email address accordingly**. +``` +[api] + insecure=true + +[providers.docker] + endpoint = "unix:///var/run/docker.sock" + exposedByDefault = false + network = "traefik" + +#[log] +# level = "DEBUG" + +[entryPoints] + [entryPoints.web] + address = ":80" + + [entryPoints.web_secure] + address = ":443" + +[certificatesResolvers.le_resolver.acme] + + email = "you_email@mail.com" + storage = "/letsencrypt/acme.json" + + tlsChallenge=true +``` \ No newline at end of file diff --git a/docs/docker/traefik/docker-compose.yml b/docs/docker/traefik/docker-compose.yml new file mode 100644 index 00000000..f5abf5d2 --- /dev/null +++ b/docs/docker/traefik/docker-compose.yml @@ -0,0 +1,40 @@ +version: "3" +services: + db_recipes: + restart: always + image: "postgres:11-alpine" + volumes: + - ./postgresql:/var/lib/postgresql/data + env_file: + - ./.env + + web_recipes: + build: . + restart: always + env_file: + - ./.env + command: "gunicorn --bind 0.0.0.0:8080 recipes.wsgi" + volumes: + - .:/Recipes + depends_on: + - db_recipes + + nginx_recipes: + image: "nginx" + restart: always + env_file: + - ./.env + volumes: + - ./nginx/conf.d:/etc/nginx/conf.d + - ./staticfiles:/static + - ./mediafiles:/media + labels: + - "traefik.enable=true" + - "traefik.http.routers.recipes.rule=Host(`recipes.mydomain.com`) || Host(`recipes.myotherdomain.com`)" + - "traefik.http.routers.recipes.entrypoints=web_secure" + - "traefik.http.routers.recipes.tls.certresolver=le_resolver" + +networks: + default: + external: + name: traefik diff --git a/preview.png b/docs/preview.png similarity index 100% rename from preview.png rename to docs/preview.png diff --git a/preview.xcf b/docs/preview.xcf similarity index 100% rename from preview.xcf rename to docs/preview.xcf