Unable to access application in Laravel 7 Docker deployment

Two months ago, my two dockerized Laravel apps were functioning properly. However, now when I attempt to log in, the app fails to authenticate. Interestingly, unauthenticated routes work without any issues. The database is operational, and even migrations and seeding are working as expected. What's puzzling is that another Laravel app with the same Dockerfile settings is running perfectly fine.

Here is a glimpse of the Dockerfile:

FROM php:7.4-apache

USER root

RUN apt-get update && apt-get install -y \
        libpng-dev \
        zlib1g-dev \
        libxml2-dev \
        libzip-dev \
        libonig-dev \
        zip \
        curl \
        unzip \
    && docker-php-ext-configure gd \
    && docker-php-ext-install -j$(nproc) gd \
    && docker-php-ext-install pdo_mysql \
    && docker-php-ext-install mysqli \
    && docker-php-ext-install zip \
    && docker-php-source delete

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

And here's a snippet from the docker-compose.yaml file:

version: '3.7'

services: 
    
  app:
    build:
      context: .
      dockerfile: .docker/Dockerfile
    image: 'geninv'
    container_name: geninv
    restart: always
    ports:
      - "8000:80"
    volumes:
      - ./:/var/www/html
    networks: 
      default:

networks: 
  default:
    external: 
      name: mynet

I am utilizing MySQL 8 with an external volume on the mynet network. Any insights or help would be greatly appreciated.

Answer №1

It appears that I overlooked a simple thing.

php artisan config:cache

After recreating the cache, everything went smoothly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the method to implement foreach within a Vue select component?

Is there a way to utilize a Vue loop within a select box in order to achieve the following category and subcategory options layout: +news -sport -international +blog In PHP, I can accomplish this like so: @foreach($categories as $cat ...

Is it possible to extract data from a .xls file using PHP, organize it, and display the information without using MySQL?

I am currently learning the basics of PHP and I have an .xls file (converted from Numbers on a Mac) that contains data I want to utilize. The table in the file consists of 3 columns: Team Name, Conference, and Division, with a total of 32 rows for each co ...

Is the JSON Data Structure provided categorized correctly?

I have successfully converted my PHP result array to JSON. However, I am uncertain if it is in the correct JSON format. Here is the code I used: echo json_encode($row); I need to integrate this with a jQuery autocomplete plugin... {"0":"1","id":"1","1": ...

Trouble getting PHP and AJAX FormData to communicate with each other

I'm completely baffled! Ajax doesn't seem to be sending the file to PHP, and I can't figure out why. Can anyone make sense of this? Here is the code snippet: ----- HTML ----- <input id="mmSelectedDoc" name="selectedFiles[]" type="file" ...

What could be causing Laravel's execute() method to return duplicate results?

As a novice Laravel developer trying to export query results to a CSV file, I'm encountering confusing duplicate values in the output. Here is my code: $connection = fopen('/BSTablespace/someFile.txt', 'w'); $users = DB::table(&a ...

Solving nested URL issues in PHP

Having trouble understanding how to address this issue. What is the solution for correcting nested URLs in PHP? For example, consider a URL like example.com/index.php/index.php/index.php/index.php/index.php Is there a way to prevent nesting URLs like thi ...

What is the best way to display a custom Taxonomy variable that includes a hyphen?

Hey everyone, I'm new to php so bear with me if I'm not using the correct jargon. I've been tasked with updating an older website that utilizes a custom WordPress taxonomy: register_taxonomy('user-categories',array('user-pos ...

Incorporate Laravel data into Angular dropdown menu

Hello, I am utilizing Angular to populate a select box with options. I have fetched a list of tags that are structured as follows (encoded in JSON using Laravel for better readability); Effort options to be displayed in selection { "5. XS":{"94":"01:00: ...

Having difficulties grasping the concept of how to communicate effectively with my MySQL database

Apologies in advance for asking a question that may have been answered elsewhere, but I've been struggling for hours to transfer the information into my own program. Despite my attempts, I always encounter the same obstacles. So, I decided it would be ...

Is it possible to access protected properties using the __get() method and the -> operator?

Our team has implemented lazyloading techniques to load sub-objects from the database. We are using the magic __get() method along with a database call. All properties are protected, so the __get method is called from outside the object. However, we have e ...

Managing asynchronous requests with CodeIgniter

In my approach to handling success and error messages, I have been using json encoded arrays as responses. However, it recently occurred to me that this may not be the most appropriate way to manage notifications. Here's an example of how I handle th ...

What is the best way to obtain validation when saving multiple records using newEntities() in CakePHP 3.x?

Whenever I attempt to save multiple records, I am not receiving any validation errors. Even though I can retrieve the errors by using print_r($user->errors());, they are not automatically displayed in the form like they are when saving a single user. The d ...

What causes an "Undefined index" error in jQuery when making AJAX requests?

Whenever I make an AJAX request in my main.js file, I encounter the following error message: Undefined index: id in sqlinfo.php on line 13 I am puzzled because I believe that I am populating the request object correctly. What's even more perplexing i ...

Changing the locale in Silverstripe with the fluent module

Good day, I am curious if anyone is aware of a way to manually set the locale. I need to update some items in the database based on the locale using a cronjob, but instead of using the server's locale, I want to set it based on certain variables. Is ...

PHP incorporate diverse files from various subfolders located within the main directory

My question is similar to PHP include file strategy needed. I have the following folder structure: /root/pages.php /root/articles/pages.php /root/includes/include_files.php /root/img/images.jpg All pages in the "/root" and "/root/art ...

filtering out specific sections of HTML using xPath

I am currently attempting to scrape information from this page My approach involves using xPath to select specific elements. Here is a snippet of my code: $safeFlag = true ; //*[@id="tabset_productPage"]/dd[1]/div/div //HAVE TRIED THIS TOO //*[@id="tab ...

Deciphering an HTTP request in a Node.js script

Currently, I am endeavoring to concoct a script that navigates to a script on localhost and interprets it within a node.js script. Take a glance at my progress thus far: var http = require('http'); var options = { host:'127.0.0.1' ...

Step-by-step guide on setting up and utilizing the eth-auth (ethauth-server) library

Can you explain the purpose and usage of the eth-auth library? Additionally, could you provide instructions on how to incorporate the ethauth-server npm library into a node.js project? ...

Using PHP to send JSONP callback responses

Is it possible to achieve "two-way" communication using JSONP and PHP? For example: jQuery / JSONP $.ajax({ url: 'http://server/po.php', cache : false, dataType: 'jsonp', timeout: 30000, type: 'GET', ...

What is a way to automatically run a function at specific intervals in PHP, similar to the setTimeout() function in JavaScript?

I have a JavaScript code snippet that looks like this: setTimeout('$.ajaxCall("notification.update", "", "GET");', 1000); Now, I want to execute the following PHP function every 1000 milliseconds, similar to the above JavaScript code: $notific ...