Mydomain.tld/public/index.php redirecting to domain.tld/public/installer after running shopware-installer.phar.php

Hello Shopware community! :wave:

I’ve set up a Caddy, PHP 8.3-FPM Alpine, MariaDB stack in Docker running on a virtual server (AlmaLinux 9 with root access)

I have the following structure

/lcmp
/lcmp/caddy_docker
/lcmp/php_docker
/www

in /lcmp there is a custom-php.ini see here

memory_limit = 640M
max_execution_time = 300
max_input_time = 300
; Additional PHP settings for Shopware 6
upload_max_filesize = 64M
post_max_size = 64M
max_input_vars = 10000

The custom-php.ini is correctly loaded into the PHP docker container

docker exec lcmp-2-php-1 php -r "echo ini_get('memory_limit').PHP_EOL;"
640M

and there is docker-compose.yaml for setting up the docker containers

version: "3.8"
services:

  # PHP Service
  php:
    build: './php_docker/'
    volumes:
      - ./www/:/var/www/html/
      - ./custom-php.ini:/usr/local/etc/php/conf.d/custom-php.ini

  # Caddy Service
  caddy:
    build: './caddy_docker/'
    depends_on:
      - php
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - ./www/:/var/www/html/
      - ./caddy_docker/Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config

  # MariaDB Service
  mariadb:
    image: mariadb:10.11
    environment:
      MYSQL_ROOT_PASSWORD: <redacted>
    volumes:
      - mysqldata:/var/lib/mysql

  # phpMyAdmin Service
  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    ports:
      - 8080:80
    environment:
      PMA_HOST: mariadb
    depends_on:
      - mariadb

# Volumes
volumes:
  mysqldata:
  caddy_data:
  caddy_config:

In /lcmp/caddy_docker there is a Dockerfile see here

# Use the official Caddy Docker image
FROM caddy:latest

# Update package index and upgrade installed packages
RUN apk update && apk upgrade

# Copy Caddyfile to configure Caddy server
COPY Caddyfile /etc/caddy/Caddyfile

and a Caddyfile see here

mydomain.tld {
  header {
    X-Frame-Options DENY
    Referrer-Policy no-referrer-when-downgrade
    X-Content-Type-Options nosniff
    Strict-Transport-Security max-age=31536000;
    -server
    -Link
    -X-Powered-By
  }

  @svg {
    file
    path *.svg
  }

  header @svg Content-Security-Policy "script-src 'none'"

  @default {
    not path /theme/* /media/* /thumbnail/* /bundles/* /css/* /fonts/* /js/* /recovery/* /sitemap/*
  }

  root * /var/www/html

  php_fastcgi php:9000
  encode zstd gzip
  file_server
}

In /lcmp/php_docker there is the Dockerfile see here

FROM php:8.3-fpm-alpine

# Downloading install-php-extensions script and making it executable
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/install-php->RUN chmod +x /usr/local/bin/install-php-extensions

# Installing PHP extensions using install-php-extensions script
RUN install-php-extensions \
    mysqli \
    pdo \
    pdo_mysql \
    gd \
    zip \
    intl \
    xml \
    curl \
    dom \
    fileinfo \
    iconv \
    json \
    libxml \
    mbstring \
    openssl \
    pcre \
    phar \
    simplexml \
    zlib

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# Cleaning APK cache
RUN rm -rf /var/cache/apk/*

Here is the output of docker ps after running docker build --no-cache and docker compse up -d in /lcmp

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
982b7afe5947 phpmyadmin/phpmyadmin:latest „/docker-entrypoint.…“ 47 minutes ago Up 47 minutes 0.0.0.0:8080->80/tcp, :::8080->80/tcp lcmp-2-phpmyadmin-1
aea6e2ed5f93 lcmp-2-caddy „caddy run --config …“ 47 minutes ago Up 47 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp, 0.0.0.0:443->443/udp, :::443->443/udp, 2019/tcp lcmp-2-caddy-1
4f2b7e22d139 mariadb:10.11 „docker-entrypoint.s…“ 47 minutes ago Up 47 minutes 3306/tcp lcmp-2-mariadb-1
0beb8e32af1c lcmp-2-php „docker-php-entrypoi…“ 47 minutes ago Up 47 minutes 9000/tcp lcmp-2-php-1

Uploading a index.html file to the folder /www/public and browsing to mydomain.tld/public/index.html works but when I browse to mydomain.tld/public/index.php or mydomain.tld/public/maintenance.php it automatically redirects to mydomain.tld/public/installer or says „File not found“

I installed Shopware 6 by uploading the shopware-installer.phar.php to the /www folder

Here similar error shopware community forum

it says mod_rewrite might not be active but I do not know if that is relevant since I’m running a Caddy server instead of Apache.

I’m really new to all this so I’m very grateful for any tips or hints you can give me regarding this issue! Sorry for the long question!

Best regards!

I was able to resolve this issue by changing the Cadddyfile, the line

root * /www had to be changed to root * /www/public

Then docker compose down --remove-orphans, docker compose build --no-cache and finally docker-compose up -d to start all the containers.

Now I’m on the page to enter the database credentials in the Shopware installer.