Comment to 'Image upload problem'
  • Did you install the application using Docker or directly on the server?

    Installation Guide for the UNA APP DEV Application Using Docker and Composer

    This guide provides detailed steps to install and run the application using Docker and Composer.

    1. Clone the Repository

    Start by cloning the application repository:

    gh repo clone unacms/una una
    

    or alternatively:

    git clone https://github.com/unacms/una.git
    

    Navigate into the cloned repository:

    cd una
    

    Switch to the desired branch (e.g., 14.0.0-RC3):

    git checkout 14.0.0-RC3
    

    2. Install Composer

    Download the Composer Docker image:

    docker pull composer/composer
    

    Note: Depending on your PHP version, you may need a specific Composer version. The latest version may not work, so ensure you're using the correct one. It’s recommended to avoid installing PHP directly on the server.

    3. Install PHP Dependencies Using Composer

    Run the following command to install the PHP dependencies for the application composer latest tag:

    docker run --rm -it -v "$(pwd):/app" composer/composer install
    

    This will execute Composer in a Docker container and install the required PHP dependencies in the current directory.

    For releases: https://github.com/composer/composer/releases

    for 2.2.9 tag example:

    docker run --rm -it -v "$(pwd):/app" composer/composer:2.2.9 install
    

    Note: After the dependencies are installed, you can remove the Composer Docker image to save space:

    docker rmi composer/composer
    

    4. Build Docker Images

    Once permissions are set, build the necessary Docker images for the services:

    docker-compose build cron
    docker-compose build php
    

    5. Set Permissions

    Before running Docker containers, ensure proper permissions are applied. Follow these steps:

    1. Create a file for setting permissions:
    vim set_permissions.sh
    
    1. Copy and paste the following script into the file:
    #!/bin/bash
    # sudo set_permissions.sh
    sudo chown -R www-data:www-data .
    sudo find ./ -type d -exec chmod 755 {} \;
    
    # Set permissions for specific directories
    sudo find ./storage -type d -exec chmod 775 {} \;
    sudo find ./tmp -type d -exec chmod 775 {} \;
    
    sudo chmod 775 ./cache
    sudo chmod 775 ./cache_public
    sudo chmod 775 ./logs
    sudo chmod 775 ./periodic
    sudo chmod 775 ./storage
    sudo chmod 775 ./tmp
    
    # Set permissions for ./inc directories before installation
    sudo chmod 755 ./inc
    
    # GitHub Folders
    sudo chown -R root:root ./.github
    sudo chown -R root:root ./.git
    sudo chmod -R 755 ./.github
    sudo chmod -R 755 ./.git
    
    # Set permissions for all files
    sudo find ./ -type f -exec chmod 644 {} \;
    
    # Set execute permissions for specific files
    sudo chmod +x ./plugins/ffmpeg/ffmpeg.exe
    sudo chmod +x ./periodic/cron.php
    sudo chmod +x ./image_transcoder.php
    
    # GitHub Files
    sudo chown root:root ./.gitignore
    
    # Set permissions for specific files
    sudo chown root:root ./docker-compose.yaml
    sudo chown root:root ./.env
    sudo chown root:root ./INSTALL.md
    sudo chown root:root ./set_permissions.sh
    
    # Set execute permissions for setup files
    sudo chmod +x ./docker-compose.yaml
    sudo chmod +x ./set_permissions.sh
    
    1. Make the script executable:
    chmod +x set_permissions.sh
    
    1. Run the script:
    sudo ./set_permissions.sh
    

    This will apply the appropriate permissions for all directories and files as specified in the script.

    6. Add Your Environment Variables

    Set up your .env file with the necessary environment variables.

    7. Run Docker Containers Using docker-compose

    To run the application, use Docker Compose. Ensure your docker-compose.yml file is properly configured.

    docker-compose up
    

    This will start the Docker containers as defined in the docker-compose.yml file, enabling the application to run.

    8. Access the Application

    Once the application is running, open your web browser and navigate to www.example.com to access the application. Follow the on-screen instructions to complete the installation process.

    This guide covers the steps to download Composer using Docker, install PHP dependencies, and run the application using Docker Compose.

    Regarding Varnish, I don’t have experience with it personally. My projects typically use Memcached, Dragonfly, and Redis, with Nginx as a proxy and Caddy as a reverse proxy. However, if you provide more details about your Varnish setup, I can offer further suggestions based on your configuration.