简体   繁体   中英

Dockerfile | Alpine | Nginx | php7 | MongoDB | Redis

I am looking for a Dockerfile which has Nginx, Php7, MongoDB & Redis enabled on Alpine. Managed to get below but while executing it I see below errors. Please suggest.

Dockerfile:-

FROM trafex/alpine-nginx-php7
 USER root
  RUN apk add --update --virtual build_deps bash gcc g++ autoconf make openssl-dev pcre-dev mongodb &&\
 docker-php-source extract && \
 /bin/bash -lc "pecl install mongodb" && \
 docker-php-ext-enable mongodb && \
 docker-php-source delete && \
 apk del build_deps && \
 rm -rf /var/cache/apk/* && \
 rm -rf /tmp/*
 COPY ./ /usr/share/nginx/html
 COPY ./default.conf /etc/nginx/conf.d/
 COPY ./php-fpm.conf-7.0 /etc/php-fpm-7.0.d/
 COPY ./php-fpm.conf /etc/php-fpm-7.0.d/

Error:-

/bin/sh: docker-php-source: not found /bin/bash: pecl: command not found

Referred:- https://github.com/TrafeX/docker-php-nginx/blob/master/Dockerfile

After commenting from line 2 to line 10, I managed to get Nginx running but In logs I could see below error.

[error] 9#9: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: _, request: "GET /fpm-ping HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:8080"

php-fpm.conf-7.0

upstream php-fpm {
        server 127.0.0.1:9000;
}

In alpine linux pecl is provided by php7-pear package; add it to your apk add command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM