diff --git a/.github/workflows/backend-docker-nightly.yml b/.github/workflows/backend-docker-nightly.yml new file mode 100644 index 000000000000..bca854638728 --- /dev/null +++ b/.github/workflows/backend-docker-nightly.yml @@ -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 . diff --git a/.github/workflows/frontend-docker-nightly.yml b/.github/workflows/frontend-docker-nightly.yml new file mode 100644 index 000000000000..1bc15cd3c173 --- /dev/null +++ b/.github/workflows/frontend-docker-nightly.yml @@ -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 . diff --git a/.github/workflows/frontend-lint.yml b/.github/workflows/frontend-lint.yml index 265b99601fe2..3b52072a5e85 100644 --- a/.github/workflows/frontend-lint.yml +++ b/.github/workflows/frontend-lint.yml @@ -1,4 +1,4 @@ -name: ci +name: Frontend Lint on: push: diff --git a/Caddyfile b/Caddyfile index 9e08f53c869b..92dad003268c 100644 --- a/Caddyfile +++ b/Caddyfile @@ -22,7 +22,7 @@ handle @proxied { uri strip_suffix / - reverse_proxy http://127.0.0.1:9000 + reverse_proxy http://mealie-api } handle { diff --git a/Dockerfile b/Dockerfile index 7fe66a057c1d..8a23885847c9 100644 --- a/Dockerfile +++ b/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 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 682dd0d9c1da..87a1d51f153c 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 4d48fe0682c7..ac6b4ce3c12c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/frontend.old/package.json b/frontend.old/package.json index 658552cc44e7..fd27e435ebec 100644 --- a/frontend.old/package.json +++ b/frontend.old/package.json @@ -73,4 +73,4 @@ "last 2 versions", "not dead" ] -} +} \ No newline at end of file diff --git a/mealie/core/root_logger.py b/mealie/core/root_logger.py index 39149ba7edc5..9dd359ad2077 100644 --- a/mealie/core/root_logger.py +++ b/mealie/core/root_logger.py @@ -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,