У меня есть проект Symfony 5 и файл docker-compose.yml в корне этого проекта для создания контейнера Apache. Docker-compose.yml был успешно развернут, но когда я пытаюсь получить доступ к http: // localhost, У меня эта ошибка HTTP на пустой странице:
Вот мой vhost:
<VirtualHost *:80>
DocumentRoot "/var/www/html/public"
ServerName localhost
<Directory "/var/www/html/public">
AllowOverride all
</Directory>
</VirtualHost>
docker-compose.yml:
version: "3"
services:
webserver:
build:
context: ./.docker/bin/webserver
container_name: '7.4.x-webserver'
restart: 'always'
ports:
- "${HOST_MACHINE_UNSECURE_HOST_PORT}:80"
- "${HOST_MACHINE_SECURE_HOST_PORT}:443"
links:
- mysql
volumes:
- "${DOCUMENT_ROOT}:/var/www/html"
- "${PHP_INI}:/usr/local/etc/php/php.ini"
- "${VHOSTS_DIR}:/etc/apache2/sites-enabled"
- "${APACHE_LOG_DIR}:/var/log/apache2"
mysql:
build:
context: "./.docker/bin/${DATABASE}"
container_name: 'mysql'
restart: 'always'
ports:
- "${HOST_MACHINE_MYSQL_PORT}:3306"
volumes:
- "${MYSQL_DATA_DIR}:/var/lib/mysql"
- "${MYSQL_LOG_DIR}:/var/log/mysql"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: 'sc-phpmyadmin'
links:
- mysql
environment:
PMA_HOST: mysql
PMA_PORT: 3306
PMA_USER: ${MYSQL_USER}
PMA_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- '${HOST_MACHINE_PHPMYADMIN_PORT}:80'
volumes:
- ./.docker/sessions
redis:
container_name: 'sc-redis'
image: redis:latest
ports:
- "${HOST_MACHINE_REDIS_PORT}:6379"
.env:
###> docker ###
DOCUMENT_ROOT=./
VHOSTS_DIR=./.docker/config/vhosts
APACHE_LOG_DIR=./.docker/logs/apache2
PHP_INI=./.docker/config/php/php.ini
DATABASE=mysql8
MYSQL_DATA_DIR=./.docker/data/mysql
MYSQL_LOG_DIR=./.docker/logs/mysql
HOST_MACHINE_UNSECURE_HOST_PORT=80
HOST_MACHINE_SECURE_HOST_PORT=443
HOST_MACHINE_MYSQL_PORT=3306
HOST_MACHINE_PHPMYADMIN_PORT=8080
HOST_MACHINE_REDIS_PORT=6379
MYSQL_ROOT_PASSWORD=tiger
MYSQL_USER=docker
MYSQL_PASSWORD=docker
MYSQL_DATABASE=docker
###> docker ###
Dockerfile для Apache:
FROM php:7.4.1-apache-buster
# Surpresses debconf complaints of trying to install apt packages interactively
# https://github.com/moby/moby/issues/4032#issuecomment-192327844
ARG DEBIAN_FRONTEND=noninteractive
# Update
RUN apt-get -y update --fix-missing && \
apt-get upgrade -y && \
apt-get --no-install-recommends install -y apt-utils && \
rm -rf /var/lib/apt/lists/*
# Install useful tools and install important libaries
RUN apt-get -y update && \
apt-get -y --no-install-recommends install nano wget \
dialog \
libsqlite3-dev \
libsqlite3-0 && \
apt-get -y --no-install-recommends install default-mysql-client \
zlib1g-dev \
libzip-dev \
libicu-dev && \
apt-get -y --no-install-recommends install --fix-missing apt-utils \
build-essential \
git \
curl \
libonig-dev && \
apt-get -y --no-install-recommends install --fix-missing libcurl4 \
libcurl4-openssl-dev \
zip \
openssl && \
rm -rf /var/lib/apt/lists/* && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install xdebug
RUN pecl install xdebug-2.8.0 && \
docker-php-ext-enable xdebug
# Install redis
RUN pecl install redis-5.1.1 && \
docker-php-ext-enable redis
# Other PHP7 Extensions
RUN docker-php-ext-install pdo_mysql && \
docker-php-ext-install pdo_sqlite && \
docker-php-ext-install mysqli && \
docker-php-ext-install curl && \
docker-php-ext-install tokenizer && \
docker-php-ext-install json && \
docker-php-ext-install zip && \
docker-php-ext-install -j$(nproc) intl && \
docker-php-ext-install mbstring && \
docker-php-ext-install gettext
# Install Freetype
RUN apt-get -y update && \
apt-get --no-install-recommends install -y libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure gd
# Enable apache modules
RUN a2enmod rewrite headers
# Cleanup
RUN rm -rf /usr/src/*
Почему у меня эта ошибка?