"Missing PHP version tag in Docker compose file, causing error"
P粉505450505
2023-08-30 15:55:48
<p>I'm taking a microservices course and I downloaded the project from the course website, but the project doesn't work. </p>
<p>I have a PHP Lumen project, here is its docker-compose.yml file, I updated its composer dependency before running it because my computer only has PHP 8.1: </p>
<pre class="brush:php;toolbar:false;">version: '3.7'
services:
web-academico:
build: ./php-web
volumes:
- ./php-web/:/app
- type: bind
source: ./php-web.sh
target: /app/entrypoint.sh
working_dir: /app
command: sh ./entrypoint.sh
ports:
- 8080:8080</pre>
<p>When I run this docker-compose, I get the following error message: </p>
<pre class="brush:php;toolbar:false;">Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 8.0.21 . in /app/vendor/composer/platform_check.php on line 24</pre>
<p>I tried setting the TAG to "image: php:8.1.0-fpm", but it didn't work. </p>
<p>entrypoint.sh is blank. </p>
<p>How do I resolve this issue? Why does Docker run when there is no TAG image in docker-compose.yml? </p>
I forgot the Dockerfile, the configuration information is all in that file.