0

can I ask some help for this error , I run this command docker run --rm -it -p 80:80 myapp/jelo:latest

nginx: [emerg] no port in upstream "9000" in /etc/nginx/conf.d/default.conf:17

Here is my Dockerfile

FROM php:7.4-fpm-alpine
#RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN apt-get update \
   &&  apt-get install –y nginx

COPY index.php /var/www/myapp
ADD default.conf /etc/nginx/conf.d/default.conf

EXPOSE 9000
CMD ["nginx", "-g", "daemon off;"]

Here is my default.conf

server {
        listen  80;
         index index.php;
         server_name myapp.local;
         error_log  /var/log/nginx/error.log;
         access_log /var/log/nginx/access.log;
         root /var/www/myapp;

          location / {
             try_files $uri $uri/ /index.php?$args;
           }

         location ~ \.php$ {
                 try_files $uri =404;
                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
                 fastcgi_index index.php;
                 fastcgi_pass 9000;
                 include fastcgi_params;
                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                 fastcgi_param PATH_INFO $fastcgi_path_info;
             }
     }

Thank you in advance

jemz
  • 4,987
  • 18
  • 62
  • 102

1 Answers1

0

I don't see where you are running a service in Port 9000

It should be somewhere in dockerfile, like

php start index.php --port 9000 --background

I'm not familiar with php

RammusXu
  • 1,180
  • 1
  • 7
  • 21