Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
Laravel no encontrado, Docker, Apache2

Estoy tratando de conectarme a mi contenedor, pero recibo el siguiente error. Antes mi contenedor funciona sin problemas. Hice una nueva compilación pero no funciona.

Mi archivo Docker es el siguiente:

 FROM php:7.2-apache LABEL maintainer="christianahvilla@gmail.com" # Install PHP RUN apt-get update && apt-get install -y \ curl \ zlib1g-dev \ libzip-dev \ nano # Add and Enable PHP-PDO Extenstions RUN docker-php-ext-install mysqli pdo pdo_mysql RUN docker-php-ext-enable pdo_mysql RUN docker-php-ext-install zip # # Install PHP Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer #set our application folder as an environment variable ENV APP_HOME /var/www/html #change uid and gid of apache to docker user uid/gid RUN usermod -u 1000 www-data && groupmod -g 1000 www-data COPY --chown=www-data:www-data . $APP_HOME #Expose Port 8000 since this is our dev environment EXPOSE 8000

Mi Docker-Compose:

 version: "3.7" services: #Laravel App web: build: context: . dockerfile: Dockerfile ports: - 8000:80 volumes: - ./:/var/www - ./public:/var/www/html networks: - mynet depends_on: - db #MySQL Service db: image: mysql:5.7 container_name: db ports: - 3306:3306 environment: MYSQL_DATABASE: MYSQL_USER: MYSQL_PASSWORD: MYSQL_ROOT_PASSWORD: volumes: - mysqldata:/var/lib/mysql/ networks: - mynet #Docker Networks networks: mynet: driver: bridge #Volumes volumes: mysqldata: driver: local

Cuando trato de acceder a http:localhost:8000/ puedo hacerlo, pero si intento acceder a otra ruta, aparece el error.

ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tienes que configurar apache2.conf en /etc/apache2/apache2.conf desde Dockerfile, y también a2endmode rewrite , finalmente necesitas reiniciar apache2:

 RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf RUN a2enmod rewrite RUN service apache2 restart

Luego ejecute docker-compose build y docker-compose up -d

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!