Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
400 stars 53 forks source link

Error while using Docker #191

Closed raynorcorgio closed 4 months ago

raynorcorgio commented 5 months ago

Hi, I'm starting to learn up sage root with this tutorial on YouTube.. And I'm using docker for this since I'm using a windows machine. Timis Digital.

When im on the point of adding options where he use this command wp acorn acf:options ThemeOptions im getting error this error:

Warning: No WordPress installation found. If the command 'acorn acf:options ThemeOptions' is in a plugin or theme, pass --path=`path/to/wordpress`.
Error: 'acorn' is not a registered wp command. See 'wp help' for available commands.
Did you mean 'core'?

so I tried the flag --path=''path/to/wordpress so i use this command since im using docker:

docker exec wpcli wp acorn acf:options ThemeOptions --path=`/var/www/html/`

but it gives me this error:

bash: /var/www/html/: No such file or directory
Error: The --path parameter cannot be empty when provided.

To reproduce this error here are my docker-compose file and env:

version: '3.5'

services:
  wordpress:
    image: wordpress:6.4.3
    env_file:
      - .env
    environment:
      WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST}
      WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
      WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
      WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
      WORDPRESS_TABLE_PREFIX: ${WORDPRESS_TABLE_PREFIX}
      WORDPRESS_DEBUG: ${WORDPRESS_DEBUG}
      WORDPRESS_CONFIG_EXTRA: ${WORDPRESS_CONFIG_EXTRA}
    ports:
      - '80:80'
    volumes:
      - ./src/plugins:/var/www/html/wp-content/plugins
      - ./src/themes:/var/www/html/wp-content/themes

  db:
    build:
      context: .
      dockerfile: ./dockerfile/database/Dockerfile
    image: mariadb:11.2
    env_file:
      - .env
    environment:
      - MYSQL_ROOT_PASSWORD=${WORDPRESS_DB_PASSWORD}
      - MYSQL_DATABASE=${WORDPRESS_DB_NAME}
    volumes:
        - db_data:/var/lib/mysql
        - ./migrations/wordpress.sql:/docker-entrypoint-initdb.d/wordpress.sql

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    env_file:
      - .env
    links:
      - db
    environment:
      PMA_HOST: ${WORDPRESS_DB_HOST}
      PMA_USER: ${WORDPRESS_DB_USER}
      PMA_PASSWORD: ${WORDPRESS_DB_PASSWORD}
      PMA_PORT: 3306
    restart: always
    ports:
      - '8081:80'

  wpcli:
    image: wordpress:cli-2.9-php8.3
    env_file:
      - .env
    volumes:
      - wordpress:/var/www/html
      - ./migrations:/var/www/html/migrations
    environment:
      WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST}
      WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
      WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
      WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
    container_name: wpcli
    depends_on:
      - db
      - wordpress
    user: 1000:1000
    command: tail -f /dev/null

volumes:
  db_data:
  wordpress:

.ENV

WORDPRESS_DB_HOST=db
WORDPRESS_DB_USER=root
WORDPRESS_DB_PASSWORD=root
WORDPRESS_DB_NAME=wordpress
WORDPRESS_TABLE_PREFIX=wp_
WORDPRESS_DEBUG=1
WORDPRESS_CONFIG_EXTRA=''

thank you in advance!

Log1x commented 4 months ago

Hi. This doesn't appear to be an issue with ACF Composer. I'm not sure how to help as I am not familiar with your setup. WP-CLI should generally work any time you're in a working directory that has a WordPress installation as a parent.