Docker compose, apache2: Could not reliably determine the server's fully qualified domain name,
Answer a question
I know a very similar answer has already been dealt with here BUT in my case I am using an already made docker image (https://hub.docker.com/r/prestashop/prestashop/) and I don't think I can modify the Dockerfile
I think I need to execute this command echo "ServerName localhost" >> /etc/apache2/apache2.conf but I don't know how, idealy I would like to gather all the configurations in the docker-compose.yml file, here it is:
version: "3.7"
services:
app:
image: prestashop/prestashop:1.7
ports:
- 8080:80
working_dir: /var/www/html
volumes:
- ./:/var/www/html
environment:
DB_SERVER: mysql
MYSQL_USER: root
MYSQL_PASSWORD: mypass123
MYSQL_DB: prestashop
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: mypass123
MYSQL_DATABASE: prestashop
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- 8081:80
environment:
MYSQL_ROOT_PASSWORD: mypass123
MYSQL_DATABASE: prestashop
When I run docker-compose up I get this "error"
phpmyadmin_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
app_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.4. Set the 'ServerName' directive globally to suppress this message
Any idea ?
Thank you
Aymeric
Answers
You can modify the container by creating the following Dockerfile
FROM prestashop/prestashop:1.7
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
and modify the docker-compose.yml
...
services:
app:
build: .
ports:
- 8080:80
working_dir: /var/www/html
...
更多推荐



所有评论(0)