FROM php:7.4-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libpng-dev
libmcrypt-dev
gcc
make
&& docker-php-ext-configure gd --with-freetype --with-jpeg
&& docker-php-ext-install -j$(nproc) gd
RUN set -xe;
apt-get update -yqq &&
pecl channel-update pecl.php.net &&
apt-get install -yqq
apt-utils
libzip-dev zip unzip &&
docker-php-ext-configure zip;
docker-php-ext-install zip &&
php -m | grep -q 'zip'
RUN docker-php-ext-install pdo_mysql
RUN apt-get install -y nano
RUN apt-get install -y build-essential cron
RUN apt-get install -y cron
RUN apt-get install -y procps
RUN apt-get install -y net-tools
RUN apt-get update && apt-get install libmagickwand-dev -y --no-install-recommends
&& pecl install imagick-3.5.1
&& docker-php-ext-enable imagick
RUN apt-get install -y ghostscript
COPY --from=composer /usr/bin/composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /composer
ENV PATH $PATH:/composer/vendor/bin
WORKDIR /var/www
RUN apt-get install -y git
COPY ./src /var/www
COPY ./php/php.ini /usr/local/etc/php/php.ini
COPY ./php/policy.xml /etc/ImageMagick-6/policy.xml
RUN chmod -R 777 /var/www/storage
RUN chmod -R 777 /var/www/bootstrap
I have docker file like this.
It can create the container but, there is no server in it.
in container, it accept only ip6
tcp6 0 0 :::9000 :::* LISTEN
I want to access fpm-cgi server by curl localhost 9000
Where should I set?
2
Answers
try it in the docker container
if it works, you can add it to Dockerfile as below
you can check stop,start,staus
First and foremost, fix your permissions and do not expose services running as
root
.Next, you need to expose the service to the containers network, preferably as
nginx
.