nginx exits error code 0 with docker compose

Brian Carey biscotty666 at gmail.com
Mon Sep 5 23:14:01 UTC 2022


I'm trying to run nginx/mysql/php in docker. Everything seems to run 
fine. I have added tty: true and changed the

Here is my Dockerfile, docker-compose.yaml and the nginx-related output. 
I did try adding tty: true but it made no difference.

Any ideas? Thanks in advance.

biscotty

'''

FROM nginx:alpine

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

EXPOSE 80 443

'''

'''

version: '3'

services:
  php-fpm:
    build:
      context: ./php-fpm

  nginx:
    build:
      context: ./nginx
    volumes:
      - ../src:/var/www
    ports:
      - target: 80
        host_ip: 127.0.0.1
        published: 8080
        protocol: tcp
        mode: host

      - target: 80
        host_ip: 127.0.0.1
        published: 8000-9000
        protocol: tcp
        mode: host


  database:
    build:
      context: ./database
    environment:
      - MYSQL_DATABASE=containerphp
      - MYSQL_USER=container
      - MYSQL_PASSWORD=container
      - MYSQL_ROOT_PASSWORD=*******

'''

'''

docker-nginx-1 | /docker-entrypoint.sh: /docker-entrypoint.d/ is not 
empty, will attempt to perform configuration
docker-nginx-1     | /docker-entrypoint.sh: Looking for shell scripts in 
/docker-entrypoint.d/
docker-nginx-1     | /docker-entrypoint.sh: Launching 
/docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
docker-nginx-1     | 10-listen-on-ipv6-by-default.sh: info: Getting the 
checksum of /etc/nginx/conf.d/default.conf
docker-nginx-1     | 10-listen-on-ipv6-by-default.sh: info: Enabled 
listen on IPv6 in /etc/nginx/conf.d/default.conf
docker-nginx-1     | /docker-entrypoint.sh: Launching 
/docker-entrypoint.d/20-envsubst-on-templates.sh
docker-nginx-1     | /docker-entrypoint.sh: Launching 
/docker-entrypoint.d/30-tune-worker-processes.sh
docker-nginx-1     | /docker-entrypoint.sh: Configuration complete; 
ready for start up
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 1#1: using the "epoll" 
event method
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 1#1: nginx/1.23.1
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 1#1: built by gcc 
11.2.1 20220219 (Alpine 11.2.1_git20220219)
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 1#1: OS: Linux 
5.15.0-46-generic
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 1#1: 
getrlimit(RLIMIT_NOFILE): 1048576:1048576
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 32#32: start worker 
processes
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 32#32: start worker 
process 33
docker-nginx-1     | 2022/09/05 22:55:51 [notice] 32#32: start worker 
process 34
docker-nginx-1 exited with code 0

'''
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20220905/9dfc6879/attachment.htm>


More information about the nginx mailing list