Skip to content

Commit

Permalink
Merge pull request 'added favicon, fixed docker milisearch' (#165) fr…
Browse files Browse the repository at this point in the history
…om 7.x-bugfixes into 7.x

Reviewed-on: https://git.narrenhaus.ch/Narrenhaus/RecipeManager/pulls/165
  • Loading branch information
Benjamin Ammann committed Feb 23, 2021
2 parents b29248a + ec05c54 commit 2d1be56
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Get the full description at storage/docker/README.md
# Get the full description at https://github.com/ammannbe/RecipeManager/blob/master/storage/docker/README.md

APP_NAME=RecipeManager
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000

APP_VERSION=7
APP_VERSION=7.0
MARIADB_VERSION=10.5.8
REDIS_VERSION=6.0-alpine
MEILISEARCH_VERSION=v0.18.1
Expand Down Expand Up @@ -71,5 +71,6 @@ MIX_DISABLE_COOKBOOKS=$DISABLE_COOKBOOKS
MIX_DISABLE_TAGS=$DISABLE_TAGS
MIX_DISABLE_RATINGS=$DISABLE_RATINGS
MIX_PREFER_PAGINATION=$PREFER_PAGINATION
MIX_ICON=/img/icon.png
MIX_PLACEHOLDER_IMAGE=/img/placeholder.png
MIX_NOT_FOUND_IMAGE=/img/not-found.jpg
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Alternatively or for development purposes you can make a manual installation on
- Generate storage symlink `php artisan storage:link`
- Generate an app key `php artisan key:generate`
- Migrate the database `php artisan migrate`
- Import meilisearch indexes `php artisan scout:index recipes && php artisan scout:import "App\Models\Recipes\Recipe"`
- Add following to your crontab:

```bash
Expand Down Expand Up @@ -96,6 +97,7 @@ php artisan view:cache
- Optimize composer autoload `composer install`
- Install NPM packages `npm install`
- Migrate the database `php artisan migrate`
- Import meilisearch indexes `php artisan scout:index recipes && php artisan scout:import "App\Models\Recipes\Recipe"`
- Follow [Development deployment](#development-deployment) or [Production deployment](#production-deployment)

## Translations
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
17 changes: 15 additions & 2 deletions resources/js/components/Mixins/TheMenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<div class="navbar-brand">
<div class="navbar-item">
<router-link :to="{ name: 'home' }">
<img :src="$env.LOGO" :alt="$t('Logo')" />
<h1 @click="$emit('search')" class="title">{{ $env.APP_NAME }}</h1>
</router-link>
</div>
Expand Down Expand Up @@ -164,8 +165,20 @@ export default {
.navbar {
z-index: 9999;
.navbar-item.lang {
justify-content: space-around;
.navbar-item {
&.lang {
justify-content: space-around;
}
> a {
display: flex;
align-items: center;
> img {
margin-right: 7px;
max-height: 3rem;
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions resources/js/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default {
DISABLE_REGISTRATION: process.env.MIX_DISABLE_REGISTRATION == 'true',
DISABLE_COOKBOOKS: process.env.MIX_DISABLE_COOKBOOKS == 'true',
DISABLE_TAGS: process.env.MIX_DISABLE_TAGS == 'true',
DISABLE_RATINGS: process.env.DISABLE_RATINGS == 'true',
PREFER_PAGINATION: process.env.MIX_PREFER_PAGINATION == 'true',
MAX_RATING_STARS: process.env.MIX_MAX_RATING_STARS,
PLACEHOLDER_IMAGE: process.env.MIX_PLACEHOLDER_IMAGE,
LOGO: process.env.MIX_LOGO,
NOT_FOUND_IMAGE: process.env.MIX_NOT_FOUND_IMAGE
}
2 changes: 1 addition & 1 deletion resources/js/views/Recipe/Add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div
class="column is-full-mobile is-full-tablet is-three-fifths-desktop is-offset-one-fifth-desktop"
>
<h1 class="title has-text-centered">{{ $t("Infos") }}</h1>
<h1 class="title has-text-centered">{{ $t("Add recipe") }}</h1>

<form @submit.prevent="submit">
<rm-textinput
Expand Down
5 changes: 1 addition & 4 deletions resources/js/views/Recipe/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<hr />

<rating-card-list />
<rating-card-list v-if="ratings && ratings.data && ratings.data.length" />
</div>

<div class="edit-buttons" v-if="this.loggedIn && recipe.can_edit">
Expand Down Expand Up @@ -88,8 +88,6 @@

<script>
import { mapState, mapGetters } from "vuex";
import Recipes from "../../modules/ApiClient/Recipes";
import Ingredients from "../../modules/ApiClient/Ingredients";
import SocialSharing from "./SocialSharing";
import RecipeTitle from "./RecipeTitle";
import RecipePhoto from "./RecipePhoto";
Expand Down Expand Up @@ -177,7 +175,6 @@ export default {
computed: {
...mapState({
recipe: state => state.recipe.data,
ratings: state => state.ratings.data,
editmode: state => state.recipe.editmode.data,
form: state => state.recipe.form.data
}),
Expand Down
3 changes: 2 additions & 1 deletion resources/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@
"Hide ratings": "Bewertungen verbergen",
"Fix aspect ratio": "Seitenverhältnis fixieren",
"Width": "Breite",
"Heigth": "Höhe"
"Heigth": "Höhe",
"Logo": "Logo"
}
1 change: 1 addition & 0 deletions resources/views/layouts/head.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">

<title>{{ config('app.name') }}</title>

Expand Down
19 changes: 12 additions & 7 deletions storage/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,21 @@ services:

volumes:
- ./html:/var/www/html
- ./entrypoint.sh:/usr/local/bin/entrypoint.sh
- ./data/app:/var/www/html/storage/app
- ./favicon.ico:/var/www/html/favicon.ico
- ./entrypoint.sh:/usr/local/bin/entrypoint.sh
- ./.env:/var/www/html/.env
- ./ports.conf:/etc/apache2/ports.conf
```

In the containers _app_, _scheduler_, _queue_ you can override following paths:

- **./html:/var/www/html** This is the folder containing all project files
- **./entrypoint.sh:/usr/local/bin/entrypoint.sh** This script is executet at the ENTRYPOINT (see Dockerfile)
- **./data/app:/var/www/html/storage/app** This folder contains user data like recipe images
- **./favicon.ico:/var/www/html/favicon.ico** Specify a custom favicon
- **./entrypoint.sh:/usr/local/bin/entrypoint.sh** This script is executet at the ENTRYPOINT (see Dockerfile)
- **./.env:/var/www/html/.env** This is the environement variable file
- **./ports.conf:/etc/apache2/ports.conf** Specify a custom Apache HTTP port

# Environement Variables

Expand All @@ -76,9 +79,10 @@ See also: [Laravel Configuration](https://laravel.com/docs/8.x/configuration)

## App versions

- **APP_VERSION:** Docker image version. _Default: latest_
- **MARIADB_VERSION:** Docker image version. _Default: latest_
- **REDIS_VERSION:** Docker image version. _Default: latest_
- **APP_VERSION:** Docker image version.
- **MARIADB_VERSION:** Docker image version.
- **REDIS_VERSION:** Docker image version.
- **MEILISEARCH_VERSION:** Docker image version.

## Locales

Expand Down Expand Up @@ -163,5 +167,6 @@ See also [Laravel Mail](https://laravel.com/docs/8.x/mail)
- **MIX_DISABLE_COOKBOOKS:** _Default: \$DISABLE_COOKBOOKS_
- **MIX_DISABLE_TAGS:** _Default: \$DISABLE_TAGS_
- **MIX_PREFER_PAGINATION:** _Default: \$PREFER_PAGINATION_
- **MIX_PLACEHOLDER_IMAGE:** Path or URL to a placeholder image _Default: /storage/placeholder.png_
- **MIX_NOT_FOUND_IMAGE:** Path or URL to a fallback image _Default: /storage/not-found.jpg_
- **MIX_LOGO:** Path or URL to the logo _Default: /img/logo.png_
- **MIX_PLACEHOLDER_IMAGE:** Path or URL to a placeholder image _Default: /img/placeholder.png_
- **MIX_NOT_FOUND_IMAGE:** Path or URL to a fallback image _Default: /img/not-found.jpg_
3 changes: 3 additions & 0 deletions storage/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
depends_on:
- db
- redis
- meilisearch

queue:
image: suhype/recipe-manager:${APP_VERSION}
Expand Down Expand Up @@ -81,5 +82,7 @@ services:
restart: always
environment:
- MEILI_MASTER_KEY=${MEILISEARCH_KEY}
volumes:
- ./data/meilisearch:/data.ms
networks:
- recipe-manager
10 changes: 7 additions & 3 deletions storage/docker/root/usr/local/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ if [[ "$role" == "app" ]]; then
# Compile JS/CSS
sudo -u www-data npm run prod

echo "Wait 30s until MariaDB is up and running"
echo "Wait 30s until external services are up and running"
sleep 30

# Import meilisearch indexes
sudo -u www-data php artisan scout:index recipes
sudo -u www-data php artisan scout:import "App\Models\Recipes\Recipe"

# Migrate Database
sudo -u www-data php artisan migrate --force

Expand All @@ -35,13 +39,13 @@ elif [[ "$role" == "scheduler" ]]; then
sleep 300
echo "Running the scheduler..."
while [ true ]; do
sudo -u www-data php /var/www/html/artisan schedule:run --no-interaction &
sudo -u www-data php artisan schedule:run --no-interaction &
sleep 60
done
elif [[ "$role" == "queue" ]]; then
sleep 300
echo "Running the queue..."
sudo -u www-data php /var/www/html/artisan queue:work
sudo -u www-data php artisan queue:work
else
echo "Could not match the container role \"$role\""
exit 1
Expand Down

0 comments on commit 2d1be56

Please sign in to comment.