mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	add nightly CI/CD
This commit is contained in:
		
							
								
								
									
										49
									
								
								.github/workflows/backend-docker-nightly.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.github/workflows/backend-docker-nightly.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| name: Backend - Nightly Build | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - mealie-next | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       # | ||||
|       # Checkout | ||||
|       # | ||||
|       - name: checkout code | ||||
|         uses: actions/checkout@v2 | ||||
|       # | ||||
|       # Setup QEMU | ||||
|       # | ||||
|       - name: Set up QEMU | ||||
|         id: qemu | ||||
|         uses: docker/setup-qemu-action@v1 | ||||
|         with: | ||||
|           image: tonistiigi/binfmt:latest | ||||
|           platforms: all | ||||
|       # | ||||
|       # Setup Buildx | ||||
|       # | ||||
|       - name: install buildx | ||||
|         id: buildx | ||||
|         uses: docker/setup-buildx-action@v1 | ||||
|         with: | ||||
|           install: true | ||||
|       # | ||||
|       # Login to Docker Hub | ||||
|       # | ||||
|       - name: Login to Docker Hub | ||||
|         uses: docker/login-action@v1 | ||||
|         with: | ||||
|           username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||
|           password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||
|       # | ||||
|       # Build | ||||
|       # | ||||
|       - name: build the image | ||||
|         run: | | ||||
|           docker build --push --no-cache \ | ||||
|             --tag hkotel/mealie:api-nightly \ | ||||
|             --platform linux/amd64,linux/arm64 . | ||||
							
								
								
									
										50
									
								
								.github/workflows/frontend-docker-nightly.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								.github/workflows/frontend-docker-nightly.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,50 @@ | ||||
| name: Frontend - Nightly Build | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - mealie-next | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       # | ||||
|       # Checkout | ||||
|       # | ||||
|       - name: checkout code | ||||
|         uses: actions/checkout@v2 | ||||
|       # | ||||
|       # Setup QEMU | ||||
|       # | ||||
|       - name: Set up QEMU | ||||
|         id: qemu | ||||
|         uses: docker/setup-qemu-action@v1 | ||||
|         with: | ||||
|           image: tonistiigi/binfmt:latest | ||||
|           platforms: all | ||||
|       # | ||||
|       # Setup Buildx | ||||
|       # | ||||
|       - name: install buildx | ||||
|         id: buildx | ||||
|         uses: docker/setup-buildx-action@v1 | ||||
|         with: | ||||
|           install: true | ||||
|       # | ||||
|       # Login to Docker Hub | ||||
|       # | ||||
|       - name: Login to Docker Hub | ||||
|         uses: docker/login-action@v1 | ||||
|         with: | ||||
|           username: ${{ secrets.DOCKERHUB_USERNAME }} | ||||
|           password: ${{ secrets.DOCKERHUB_TOKEN }} | ||||
|       # | ||||
|       # Build | ||||
|       # | ||||
|       - name: build the image | ||||
|         working-directory: "frontend" | ||||
|         run: | | ||||
|           docker build --push --no-cache \ | ||||
|             --tag hkotel/mealie:frontend-nightly \ | ||||
|             --platform linux/amd64,linux/arm64 . | ||||
							
								
								
									
										2
									
								
								.github/workflows/frontend-lint.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/frontend-lint.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| name: ci | ||||
| name: Frontend Lint | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|   | ||||
| @@ -22,7 +22,7 @@ | ||||
|  | ||||
| 	handle @proxied { | ||||
| 		uri strip_suffix / | ||||
| 		reverse_proxy http://127.0.0.1:9000 | ||||
| 		reverse_proxy http://mealie-api | ||||
| 	} | ||||
|  | ||||
| 	handle { | ||||
|   | ||||
							
								
								
									
										18
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,12 +1,12 @@ | ||||
| ############################################### | ||||
| # Frontend Builder Image | ||||
| ############################################### | ||||
| FROM node:lts-alpine as frontend-build | ||||
| WORKDIR /app | ||||
| COPY ./frontend/package*.json ./ | ||||
| RUN npm install | ||||
| COPY ./frontend/ . | ||||
| RUN npm run build | ||||
| # # Frontend Builder Image | ||||
| # ############################################### | ||||
| # FROM node:lts-alpine as frontend-build | ||||
| # WORKDIR /app | ||||
| # COPY ./frontend/package*.json ./ | ||||
| # RUN npm install | ||||
| # COPY ./frontend/ . | ||||
| # RUN npm run build | ||||
|  | ||||
| ############################################### | ||||
| # Base Image | ||||
| @@ -125,7 +125,7 @@ RUN . $VENV_PATH/bin/activate && poetry install -E pgsql --no-dev | ||||
| WORKDIR / | ||||
|  | ||||
| # copy frontend | ||||
| COPY --from=frontend-build /app/dist $MEALIE_HOME/dist | ||||
| # COPY --from=frontend-build /app/dist $MEALIE_HOME/dist | ||||
| COPY ./dev/data/templates $MEALIE_HOME/data/templates | ||||
| COPY ./Caddyfile $MEALIE_HOME | ||||
|  | ||||
|   | ||||
| @@ -7,12 +7,14 @@ services: | ||||
|     image: mealie-frontend:dev | ||||
|     build: | ||||
|       context: ./frontend | ||||
|       dockerfile: frontend.Dockerfile | ||||
|       dockerfile: Dockerfile.frontend | ||||
|     restart: always | ||||
|     ports: | ||||
|       - 9920:8080 | ||||
|     environment: | ||||
|       VUE_APP_API_BASE_URL: "http://mealie-api:9000" | ||||
|       - GLOBAL_MIDDLEWARE=null | ||||
|       - BASE_URL="" | ||||
|       - ALLOW_SIGNUP=true | ||||
|     volumes: | ||||
|       - ./frontend/:/app | ||||
|       - /app/node_modules | ||||
|   | ||||
| @@ -1,30 +1,34 @@ | ||||
| version: "3.1" | ||||
| services: | ||||
|   mealie-frontend: | ||||
|     container_name: mealie-frontend | ||||
|     image: mealie-frontend:dev | ||||
|     build: | ||||
|       context: ./frontend | ||||
|       dockerfile: Dockerfile | ||||
|     restart: always | ||||
|     ports: | ||||
|       - 9091:3000 | ||||
|     environment: | ||||
|       - GLOBAL_MIDDLEWARE=null | ||||
|       - BASE_URL="" | ||||
|       - ALLOW_SIGNUP=true | ||||
|   mealie: | ||||
|     container_name: mealie-api | ||||
|     build: | ||||
|       context: ./ | ||||
|       target: production | ||||
|       dockerfile: Dockerfile | ||||
|     container_name: mealie | ||||
|     restart: always | ||||
|     depends_on: | ||||
|       - "postgres" | ||||
|     ports: | ||||
|       - 9090:80 | ||||
|       - 9092:80 | ||||
|     environment: | ||||
|       DB_ENGINE: postgres # Optional: 'sqlite', 'postgres' | ||||
|       POSTGRES_USER: mealie | ||||
|       POSTGRES_PASSWORD: mealie | ||||
|       POSTGRES_SERVER: postgres | ||||
|       POSTGRES_PORT: 5432 | ||||
|       POSTGRES_DB: mealie | ||||
|       # DB_ENGINE: postgres # Optional: 'sqlite', 'postgres' | ||||
|       # POSTGRES_USER: mealie | ||||
|       # POSTGRES_PASSWORD: mealie | ||||
|       # POSTGRES_SERVER: postgres | ||||
|       # POSTGRES_PORT: 5432 | ||||
|       # POSTGRES_DB: mealie | ||||
|       # WORKERS_PER_CORE: 0.5 | ||||
|       # MAX_WORKERS: 8 | ||||
|       WEB_CONCURRENCY: 2 | ||||
|   postgres: | ||||
|     container_name: postgres | ||||
|     image: postgres | ||||
|     restart: always | ||||
|     environment: | ||||
|       POSTGRES_PASSWORD: mealie | ||||
|       POSTGRES_USER: mealie | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| import logging | ||||
| import sys | ||||
| from dataclasses import dataclass | ||||
| from functools import lru_cache | ||||
|  | ||||
| @@ -33,11 +34,16 @@ def get_logger_config(): | ||||
|             logger_file=None, | ||||
|         ) | ||||
|  | ||||
|     output_file_handler = logging.FileHandler(LOGGER_FILE) | ||||
|     handler_format = logging.Formatter(LOGGER_FORMAT, datefmt=DATE_FORMAT) | ||||
|     output_file_handler.setFormatter(handler_format) | ||||
|  | ||||
|     # Stdout | ||||
|     stdout_handler = logging.StreamHandler(sys.stdout) | ||||
|     stdout_handler.setFormatter(handler_format) | ||||
|  | ||||
|     return LoggerConfig( | ||||
|         handlers=[ | ||||
|             logging.FileHandler(LOGGER_FILE), | ||||
|             logging.Formatter(LOGGER_FORMAT, datefmt=DATE_FORMAT), | ||||
|         ], | ||||
|         handlers=[output_file_handler, stdout_handler], | ||||
|         format="%(levelname)s: %(asctime)s \t%(message)s", | ||||
|         date_format="%d-%b-%y %H:%M:%S", | ||||
|         logger_file=LOGGER_FILE, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user