1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How url of laravel app under docker without “public”?

Discussion in 'PHP' started by mstdmstd, Dec 30, 2018.

  1. #1
    Hello,
    Installing laravel 5.7 app under docker(based on php:7.2-apache ) I need to use "/public" in my url to run my app, so root url of my app is
    127.0.0.1:8081/public
    Code (markup):
    I modified .env of my laravel app as
    APP_URL=127.0.0.1:8081/public/
    Code (markup):
    But it did not help, as I browser I got image url :
    127.0.0.1:8081/storage/mysite/-vote-16/Babe_ver1.jpg?dt=1546059015
    Code (markup):
    which way is invalid, as valid way must be :
    127.0.0.1:8081/public/storage/mysite/-vote-16/Babe_ver1.jpg?dt=1546059015
    Code (markup):
    The similar way with ajax requests, as I got invalid ways :
    127.0.0.1:8081/admin/get_activity_log_rows/1
    Code (markup):
    But valid must be
    127.0.0.1:8081/public/admin/get_activity_log_rows/1
    Code (markup):

    In my docker-compose.yml :
    version: '3.1'
    services:
    web:
    
    build:
    context: ./web 
    dockerfile: Dockerfile.yml
    
    environment:
    - APACHE_RUN_USER=www-data
    volumes:
    - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
    ports:
    - 8081:80
    working_dir: ${APP_PTH_CONTAINER}
    
    
    composer:
    image: composer:1.8
    volumes:
    - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
    working_dir: ${APP_PTH_CONTAINER}
    command: composer install 
    
    Code (markup):
    and in .env of docker project :

    # PATHS
    DB_PATH_HOST=./databases
    APP_PATH_HOST=./mysite
    APP_PTH_CONTAINER=/var/www/html/
    
    Code (markup):
    How to set root url of my site with “/public” ?


    Thanks!
     
    mstdmstd, Dec 30, 2018 IP