Panel stays empty while page works fine

Hi,

I am trying to set up a Kirby instance using Docker. Everything works fine except that the panel stays empty (it’s just a white page). At first I thought maybe the problem is the PHP version or that the correct PHP modules are missing, but I installed everything similar to the docker-example-2 in the official tutorial.

Here is my Dockerfile:

### Base Stage
## Bootstrap from PHP container
FROM php:8.0-apache as base-stage
# set default env
ARG env=production

ENV TZ=Europe/Berlin

# Set geographic area using above variable
# This is necessary, otherwise building the image doesn't work
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Installing dependencies
RUN apt-get update \
    && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
        curl \
        git \
        make \
        less \
        nano \
        libmcrypt-dev \
        zip \
        libzip-dev

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions \
    curl \
    dom \
    gd \
    intl \
    json \
    mbstring \
    xml \
    zip

RUN apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# pecl config
RUN pecl channel-update pecl.php.net
RUN pecl config-set php_ini /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
RUN pear config-set php_ini /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini

RUN pecl install zlib zip

# Copy environment dependent php.ini file
RUN cp $PHP_INI_DIR/php.ini-$env $PHP_INI_DIR/php.ini


# Install Node JS
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs

## Copy apache config file to container
COPY files/apache.conf /etc/apache2/sites-enabled/000-default.conf

## Enable modrewrite and SSL module
RUN a2enmod headers
RUN a2enmod rewrite

WORKDIR /var/www/html/

### Production Stage
FROM base-stage as prod-stage
RUN pecl install mcrypt-1.0.3
RUN docker-php-ext-enable mcrypt
RUN a2enmod ssl

COPY ./dist ./

RUN npm install --only=prod
RUN npm run build

RUN chown -R :www-data /var/www/html
RUN chmod -R 775 /var/www/html

I am using docker-compose and build/run just the base-stage (for development).

docker-compose.yml:

version: "3.7"

services:
  chissmiii-kirby:
    image: chissmiii_kirby
    build:
      context: ./
      target: base-stage
      args:
        env: development
    container_name: chissmiii_kirby
    command: sh -c "apache2-foreground"
    ports:
      - 8000:80
      - 80:80
      - 8443:443
      - 443:443
    networks:
      - chissmiii
    volumes:
      - chissmiii_dist_vol:/var/www/html
      - chissmiii_node_modules_vol:/var/www/html/node_modules

networks:
  chissmiii:
    driver: bridge
    name: chissmiii_network

volumes:
  chissmiii_dist_vol:
    name: chissmiii_dist_src
    driver: local
    driver_opts:
      device: ./dist
      type: none
      o: bind

  chissmiii_node_modules_vol:
    name: chissmiii_node_modules

What am I missing? Would appreciate any advice.

Greetings

Make sure you have no whitespace at the top of the config file.

Thank you for your quick reply. I’ve already checked that. Also, I’ve checked, that the rewrite module is active. In the .htaccess file I’ve activated this line:

RewriteBase /

Still I have no clue, what causes this issue.

I got it. I forgot, that I put this line into the .htaccess:

RewriteRule ^media/(.*)$ index.php [L]