【发布时间】:2021-12-28 16:46:07
【问题描述】:
我正在尝试将 Angular 应用程序容器化。 这是我的 docker 文件
FROM nginx
LABEL author="sreeya"
COPY ./config/nginx.conf /etc/nginx/ngnix.cong
我用过
docker build -t nginx-angular -f nginx.dockerfile .
docker run -p 8080:80 -v $(pwd)/dist:/usr/share/nginx/html nginx-angular
构建成功,但 docker run 卡住了
start worker process 30
这是完整的输出
/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
请帮我解决
【问题讨论】:
-
您在 Dockerfile 中缺少
ENTRYPOINT行 -
我正在关注一个教程和github.com/DanWahlin/Angular-Core-Concepts,这个链接有代码。请注意,docker 文件没有 ENTRYPOINT,它似乎对他有用
-
嘿!根据那些文档,你应该使用 docker-compose,而不是 docker
标签: docker nginx docker-compose dockerfile nginx-reverse-proxy