Docker with ngnix and angular stuck at start worker process 30
Asked Answered
S

1

6

Im trying to containerize angular application. here's my docker file

FROM nginx
LABEL author="sreeya"
COPY ./config/nginx.conf /etc/nginx/ngnix.cong

I used

docker build -t nginx-angular -f nginx.dockerfile .
docker run -p 8080:80 -v $(pwd)/dist:/usr/share/nginx/html nginx-angular

build was a success, but docker run got stuck at

start worker process 30

Here's the full output

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/12/28 16:14:03 [notice] 1#1: using the "epoll" event method
2021/12/28 16:14:03 [notice] 1#1: nginx/1.21.4
2021/12/28 16:14:03 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2021/12/28 16:14:03 [notice] 1#1: OS: Linux 4.19.130-boot2docker
2021/12/28 16:14:03 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2021/12/28 16:14:03 [notice] 1#1: start worker processes
2021/12/28 16:14:03 [notice] 1#1: start worker process 30

Please help me resolve

Swats answered 28/12, 2021 at 16:46 Comment(3)
you're missing a ENTRYPOINT line in your DockerfileSherborn
Im following a tutorial and github.com/DanWahlin/Angular-Core-Concepts and this link has the code. Please notice that the docker file has no ENTRYPOINT and it seems to be working for himSwats
hey! according to those docs, youre supposed to use docker-compose, not dockerSherborn
A
2

The container is up and running, it didn't stuck there. The container is run in attached mode by default. You can either run the container in detached mode using command -

docker run -d -p 8080:80 -v $(pwd)/dist:/usr/share/nginx/html nginx-angular

Or leave it open and try checking container status in new terminal using command -

sudo docker ps
Axiology answered 28/12, 2021 at 18:23 Comment(2)
yeah, but when I visit myip:8080, I see 403 forbidden - nginx. any idea how to fix that?Swats
Add a conf under /etc/nginc/conf.d/ or /etc/ngix/sites-enabled inside docker and add server location block in it.Axiology

© 2022 - 2024 — McMap. All rights reserved.