Files
recipe-app/compose.yml
T
Nils-Johan Gynther 73bf5193c4 feat: add image handling to recipes
- Implemented image downloading and optimization in QuickImportService.
- Added imageUrl field to CreateRecipeDto for recipe creation.
- Created an endpoint in RecipesController to update recipe images.
- Enhanced RecipesService to handle image URL updates and optimizations.
- Updated Docker Compose to mount a volume for recipe images.
- Refactored frontend to display images in recipe grids and detail views.
- Added a new utility function for downloading and optimizing images.
- Created a new API route for handling image uploads.
- Introduced RecipeGrid component for better recipe display.
- Updated RecipeDetailClient to manage image updates and display.
- Added migration for new imageUrl column in the Recipe table.
2026-04-15 19:46:50 +02:00

82 lines
2.0 KiB
YAML

services:
recipe-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: recipe-frontend:local
pull_policy: never
restart: unless-stopped
environment:
NEXT_PUBLIC_API_URL: "http://recipe-api:8080"
volumes:
- recipe_images:/app/public/images
depends_on:
recipe-api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3000 >/dev/null 2>&1 || exit 1"]
interval: 20s
timeout: 10s
retries: 5
start_period: 40s
networks:
- proxy
- recipe-internal
recipe-api:
build:
context: ./backend
dockerfile: Dockerfile
image: recipe-api:local
pull_policy: never
restart: unless-stopped
environment:
DATABASE_URL: "mysql://root:${MARIADB_ROOT_PASSWORD}@recipe-db:3306/${MARIADB_DATABASE}"
volumes:
- recipe_images:/app/recipe-images
depends_on:
recipe-db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/api/health >/dev/null 2>&1 || exit 1"]
interval: 20s
timeout: 10s
retries: 10
start_period: 40s
networks:
- proxy
- recipe-internal
recipe-db:
image: mariadb:11
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
MARIADB_DATABASE: ${MARIADB_DATABASE}
MARIADB_USER: ${MARIADB_USER}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
volumes:
- recipe_db_data:/var/lib/mysql
- ./db/init:/docker-entrypoint-initdb.d
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD-SHELL", "mariadb-admin ping -h 127.0.0.1 -uroot -p$$MARIADB_ROOT_PASSWORD >/dev/null 2>&1 || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- recipe-internal
volumes:
recipe_db_data:
recipe_images:
networks:
proxy:
external: true
recipe-internal:
driver: bridge