Score:1

Project not working after moving to WSL directory

na flag

My dockerized Lumen project had slow response time so according to advices I moved my project from my classic path C:\Mgr\lumen_laravel\lumenmysql to \ \wsl.localhost\Ubuntu\home\samo\lumenmysql, then created Z:\ drive so I can open terminal in that location and run "docker-compose up -d". In previous adress it was working.I didnt change any code and have got error. Any advices? Thank you.

error in docker

2023-03-21 22:49:00 AH00112: Warning: DocumentRoot [/var/www/html/public] does not exist

According to docker inspect Mount info it exists

/VAR/WWW/HTML Z:\home\samo\lumenmysql

docker-compose.yml

version: '3.8'

services:


   mysqldb:
    image: mysql:5.7
    container_name : mysqldb
    restart: always
    volumes:
      - ${DOCKER_MYSQL_VOLUME:-/opt/db_data}:/var/lib/mysql
    ports:
      - "3306:3306"
    environment:
     MYSQL_DATABASE: diplomovka
     MYSQL_ROOT_PASSWORD: 1234

   phpmyadmin:
     image: phpmyadmin/phpmyadmin
     container_name: phpmyadmin
     environment:
       PMA_HOST: mysqldb
       DB_READ_HOST: mysqldb
     ports:
       - "3400:80"
     depends_on:
       - mysqldb

   app:
     container_name: Lumen
     build:
       context: .
       dockerfile: Dockerfile
     volumes:
       - ./:/var/www/html
     restart: ${DOCKER_RESTART_POLICY:-always}
     ports:
       - "9000:80"
     working_dir: /var/www/html
     environment:
       MYSQL_HOST: mysqldb
       MYSQL_USER: root
       MYSQL_PASSWORD: 1234
       MYSQL_PORT: 3306

vhost.conf

<VirtualHost *:80>
    ServerName localhost

    DocumentRoot /var/www/html/public

    <Directory "/var/www/html">
        AllowOverride all
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Dockerfile

FROM php:7.4.19-apache

WORKDIR /var/www/html

RUN apt-get update && apt-get install -y  \
        zlib1g-dev \
        libzip-dev \
        libonig-dev \
        curl \

    && docker-php-ext-install pdo_mysql \
    && docker-php-ext-install mysqli \
    && docker-php-source delete

COPY ./vhost.conf /etc/apache2/sites-available/000-default.conf

COPY ./ ./

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN chown -R www-data:www-data /var/www/html \
    && a2enmod rewrite

RUN cd /var/www/html && composer install && php artisan key:generate
David avatar
cn flag
The error is in a Linux format and your info is in a Windows format.
Score:0
iq flag

This is a problem between the path mapping between your WSL2 env and your windows env, using the Z:\ drive instead of the /mnt/c path.

Here is your updated docker-compose.yml file:

version: '3.8'

services:

   mysqldb:
    image: mysql:5.7
    container_name : mysqldb
    restart: always
    volumes:
      - ${DOCKER_MYSQL_VOLUME:-/opt/db_data}:/var/lib/mysql
    ports:
      - "3306:3306"
    environment:
     MYSQL_DATABASE: diplomovka
     MYSQL_ROOT_PASSWORD: 1234

   phpmyadmin:
     image: phpmyadmin/phpmyadmin
     container_name: phpmyadmin
     environment:
       PMA_HOST: mysqldb
       DB_READ_HOST: mysqldb
     ports:
       - "3400:80"
     depends_on:
       - mysqldb

   app:
     container_name: Lumen
     build:
       context: .
       dockerfile: Dockerfile
     volumes:
       - /mnt/c/Mgr/lumen_laravel/lumenmysql:/var/www/html
     restart: ${DOCKER_RESTART_POLICY:-always}
     ports:
       - "9000:80"
     working_dir: /var/www/html
     environment:
       MYSQL_HOST: mysqldb
       MYSQL_USER: root
       MYSQL_PASSWORD: 1234
       MYSQL_PORT: 3306
Samuel Kobida avatar
na flag
Thank you but this didnt help. At the moment the project is in this directory: \wsl.localhost\Ubuntu\home\samo\lumenmysql or created drive Z:\home\samo\lumenmysql . Not here C:\Mgr\lumen_laravel\lumenmysql . So i cant use /mnt/c/Mgr/lumen_laravel/lumenmysql becouse there is nothing. If i understand it right I need to use something like /mnt/z/home/samo/lumenmysql:/var/www/html but it looks like i dont have Z in mnt.
Score:0
na flag

Solution was

volumes:
- \\wsl.localhost\Ubuntu\home\samo\lumenmysql:/var/www/html
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.