secure-77 / Perlite

A web-based markdown viewer optimized for Obsidian

Home Page:https://perlite.secure77.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-compose deploying Perlite can not access the site problem

blueroseslol opened this issue · comments

I tried to run docker-compose.yml with Docker-Compose, but the Perlite-web site is still inaccessible.So how to fix this problem?

My steps

  1. Copy Perlite repository to /home/perlite.
  2. Modify the port of docker-compose.yml. 80=>8888.
  3. Run docker-compose up -d

Version

  • Docker Compose version v2.14.1
  • Docker version 20.10.22, build 3a2c30b

Logs

perlite_web:stable

/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: /etc/nginx/conf.d/default.conf differs from the packaged version
/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
2023/01/10 06:57:30 [warn] 1#1: conflicting server name "localhost" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
2023/01/10 06:57:30 [notice] 1#1: using the "epoll" event method
2023/01/10 06:57:30 [notice] 1#1: nginx/1.22.1
2023/01/10 06:57:30 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
2023/01/10 06:57:30 [notice] 1#1: OS: Linux 5.16.0-0.bpo.4-amd64
2023/01/10 06:57:30 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023/01/10 06:57:30 [notice] 1#1: start worker processes
2023/01/10 06:57:30 [notice] 1#1: start worker process 28
2023/01/10 06:57:30 [notice] 1#1: start worker process 29
2023/01/10 06:57:30 [notice] 1#1: start worker process 30
2023/01/10 06:57:30 [notice] 1#1: start worker process 31

perlite

[10-Jan-2023 06:57:29] NOTICE: fpm is running, pid 1
[10-Jan-2023 06:57:29] NOTICE: ready to handle connections

When you say you modified the port on the container. did you point 8888 to 80 in the container? or did you remove port 80 and replace it with 8888? I ask because the default nginx config used in the web container is using port 80

When you say you modified the port on the container. did you point 8888 to 80 in the container? or did you remove port 80 and replace it with 8888? I ask because the default nginx config used in the web container is using port 80

I point 8888 to 80 in the container.

My docker-compose.yml:

version: "3.9"

services:
  perlite:
    image: sec77/perlite:latest
    container_name: perlite
    restart: unless-stopped
    environment:
      - NOTES_PATH=perlite/Demo
      - HIDE_FOLDERS=docs,private,trash
      - LINE_BREAKS=true
    volumes:
      - ./perlite/Demo:/var/www/perlite/Demo:ro

  web:
    build:
        context: ./web
    image: sec77/perlite_web:stable
    container_name: perlite_web
    restart: unless-stopped
    ports:
      - 8888:80          <- I Modify
    volumes_from: 
      - perlite       
    depends_on:
      - perlite
commented

I'm not sure, but I would suggest that your warnings about the localhost binding are the problem. Check if you have left some temp file from editing your nginx config: https://stackoverflow.com/questions/11426087/nginx-error-conflicting-server-name-ignored.

running the docker-compose up (wihtout the -d) the output should look something like this

[+] Running 20/21
 ⠿ web Warning                                                                                                                                                                            1.6s
 ⠿ perlite Pulled 
[...snip...]
[+] Building 7.6s (9/9) FINISHED
[...snip...]
[+] Running 3/3
 ⠿ Network perlite_default  Created                                                                                                                                                       
 ⠿ Container perlite        Created                                                                                                                                                       
 ⠿ Container perlite_web    Created   
Attaching to perlite, perlite_web
perlite      | [11-Jan-2023 07:50:27] NOTICE: fpm is running, pid 1
perlite      | [11-Jan-2023 07:50:27] NOTICE: ready to handle connections
perlite_web  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
perlite_web  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
perlite_web  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
perlite_web  | /docker-entrypoint.sh: Configuration complete; ready for start up
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: using the "epoll" event method
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: nginx/1.22.1
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: OS: Linux 5.15.0-57-generic
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: start worker processes
perlite_web  | 2023/01/11 07:50:28 [notice] 1#1: start worker process 20

Thanks for you answer.This is my logs:

[+] Running 2/1
 ⠿ Container perlite          Recreated                                                                                                                                                 0.1s
 ⠿ Container perlite_web-dev  Recreated                                                                                                                                                 0.0s
Attaching to perlite, perlite_web
perlite      | [11-Jan-2023 08:10:35] NOTICE: fpm is running, pid 1
perlite      | [11-Jan-2023 08:10:35] NOTICE: ready to handle connections
perlite_web  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
perlite_web  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
perlite_web  | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
perlite_web  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
perlite_web  | /docker-entrypoint.sh: Configuration complete; ready for start up
perlite_web  | 2023/01/11 08:10:35 [warn] 1#1: conflicting server name "localhost" on 0.0.0.0:80, ignored
perlite_web  | nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: using the "epoll" event method
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: nginx/1.22.1
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: OS: Linux 5.16.0-0.bpo.4-amd64
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: start worker processes
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: start worker process 28
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: start worker process 29
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: start worker process 30
perlite_web  | 2023/01/11 08:10:35 [notice] 1#1: start worker process 31

Can modifying the server_name localhost; options in the /web/config/perlite.conf fix this problem?

commented

maybe, but I first would check if there is a temp file or something that is conflicting the nginx

from the stackoverflow link

I assume that you're running a Linux, and you're using gEdit to edit your files. In the /etc/nginx/sites-enabled, it may have left a temp file e.g. default~ (watch the ~).

Depending on your editor, the file could be named .save or something like it. Just run $ ls -lah to see which files are unintended to be there and remove them (Thanks [@Tisch](https://stackoverflow.com/users/82028/tisch) for this).

Delete this file, and it will solve your problem.

you can also check this by running this command

docker exec perlite_web ls -la '/etc/nginx/conf.d'

there should be only one file

-rw-r--r-- 1 root root  977 Jan 11 07:36 perlite.conf

Because I am using OMV6 NAS system, there is a website that occupies port 80, which may be the cause of the conflict.

maybe, but I first would check if there is a temp file or something that is conflicting the nginx

from the stackoverflow link

I assume that you're running a Linux, and you're using gEdit to edit your files. In the /etc/nginx/sites-enabled, it may have left a temp file e.g. default~ (watch the ~).

Depending on your editor, the file could be named .save or something like it. Just run $ ls -lah to see which files are unintended to be there and remove them (Thanks [@Tisch](https://stackoverflow.com/users/82028/tisch) for this).

Delete this file, and it will solve your problem.

you can also check this by running this command

docker exec perlite_web ls -la '/etc/nginx/conf.d'

there should be only one file

-rw-r--r-- 1 root root  977 Jan 11 07:36 perlite.conf

My logs:

My Logs:
root@bluerose:~# docker exec perlite_web ls -la '/etc/nginx/conf.d'
total 24
drwxr-xr-x 1 root root 4096 Jan 10 06:57 .
drwxr-xr-x 1 root root 4096 Dec 21 11:29 ..
-rw-r--r-- 1 root root 1022 Jan 11 08:31 default.conf
-rw-r--r-- 1 root root 1022 Jan 10 03:15 perlite.conf

Did you mean to delete the Default.conf?

commented

Because I am using OMV6 NAS system, there is a website that occupies port 80, which may be the cause of the conflict.

this shouldn't be the problem because you are redirecting the port from the container to your host port 8888.

Did you mean to delete the Default.conf?

yes, please try to remove this config, not sure why this file is still there, seems the RM command in the Docker file from the nginx container was not executed or something.

try this for testing

docker exec perlite_web rm '/etc/nginx/conf.d/default.conf'
docker exec perlite_web nginx -s reload

if this does work I would try to delete the perlite_web image and maybe also the nginx image and then run the compose command again and check if the default.conf is finally removed.

I renamed perlite.conf to default.conf and deleted the previous image and re-run docker-compose up. But I still can't access the Nginx http service.

This is Docker-Compose log:

[+] Building 1.0s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                     0.0s
 => => transferring dockerfile: 32B                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/nginx:stable                                                                                                          0.9s
 => [1/3] FROM docker.io/library/nginx:stable@sha256:9335f1c6d94691109184f04a7fdcb84b4f3b07904212e21a902c5d831f6d0486                                                    0.0s
 => [internal] load build context                                                                                                                                        0.0s
 => => transferring context: 67B                                                                                                                                         0.0s
 => CACHED [2/3] RUN rm /etc/nginx/conf.d/default.conf                                                                                                                   0.0s
 => CACHED [3/3] COPY ./config/ /etc/nginx/conf.d/                                                                                                                       0.0s
 => exporting to image                                                                                                                                                   0.0s
 => => exporting layers                                                                                                                                                  0.0s
 => => writing image sha256:bd23f3a959c0b63d308bf08afeaa233d28f4cfbfac9f899ae25b3ebc1b466115                                                                             0.0s
 => => naming to docker.io/sec77/perlite_web:stable                                                                                                                      0.0s
[+] Running 3/3
 ⠿ Network perlite_default    Created                                                                                                                                    0.0s
 ⠿ Container perlite          Started                                                                                                                                    0.5s
 ⠿ Container perlite_web-dev  Started                                                                                                                                    0.8s
root@bluerose:/home/perlite# docker logs perlite_web-dev
/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: /etc/nginx/conf.d/default.conf differs from the packaged version
/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

I think I should extract the Nginx logs for analysis, how can I do this?
I try to add volumes ./perlite/NginxLog:/var/log/nginx.But NginxLog have no log file.

version: "3.9"

services:
  perlite:
    image: sec77/perlite:latest
    container_name: perlite
    environment:
      - NOTES_PATH=Demo
      - LINE_BREAKS=true
      - HIDE_FOLDERS=docs,private,trash
    volumes:
      - ./perlite:/var/www/perlite
      - ./perlite/Demo:/var/www/perlite/Demo:ro

  web:
    build:
        context: ./web
    image: sec77/perlite_web:stable
    container_name: perlite_web-dev      
    ports:
      - 6666:80 
    volumes:
      - ./perlite:/var/www/perlite
      - ./perlite/Demo:/var/www/perlite/Demo:ro  
      - ./perlite/NginxLog:/var/log/nginx
    depends_on:
      - perlite
commented

I think ther is still a problem with your config
/etc/nginx/conf.d/default.conf differs from the packaged version

  1. try to use the perlite.conf and not the default.conf
  2. CACHED [2/3] seems that there is something cached and maybe thats the problem

please try the following:

  1. stop all perlite containers
  2. delete all perlite images
docker image rm sec77/perlite_web:stable
docker image rm sec77/perlite:latest
  1. make sure there is only the perlite.conf in the Perlite/web/config directory of the Repo
  2. run docker-compose build --no-cache
  3. run docker-compose up again
  4. double check if there is finally only the perlite.conf in the perlite_web container
docker exec perlite_web ls -la '/etc/nginx/conf.d'

I've tried, but it doesn't work.I only modify docker-compose.yml.

 web:
    ports:
      - 11111:80

This is my logs:

root@bluerose:/home/perlite# docker-compose down
[+] Running 3/3
 ⠿ Container perlite_web-dev  Removed                                                                                                                                    0.4s
 ⠿ Container perlite          Removed                                                                                                                                    0.2s
 ⠿ Network perlite_default    Removed                                                                                                                                    0.2s
root@bluerose:/home/perlite# docker image rm sec77/perlite_web:stable
docker image rm sec77/perlite:latest
Untagged: sec77/perlite_web:stable
Deleted: sha256:bd23f3a959c0b63d308bf08afeaa233d28f4cfbfac9f899ae25b3ebc1b466115
Untagged: sec77/perlite:latest
Untagged: sec77/perlite@sha256:fc9297acbcac3e708a3f65def51a563bc1fdfe700db4865077b63bb0d5850f95
Deleted: sha256:a3a0d8bcd1375dedd529d01a9c51e91fb91349cd26bb308e71aa495cf172d2e7
Deleted: sha256:802fb331fdf0c96bff680a2e0841bbc43213d344d36308c5b06a40cceb345f26
Deleted: sha256:78f950eb31db8456ec44aed45417bfc128cbd51adc8d9b9d9203fbfbf14066c4
Deleted: sha256:b7355a7bb5b8ef3d121ed7c9b84048ffe6630b031fe83241ddf21667c3686443
Deleted: sha256:90004e2a86ec46f5c60a2f6445f52e48af4972e56c7f562f93f6f7e578d557e2
Deleted: sha256:05b1510ebd78f4b8542f654709371f44605794894694b9a6ec3ae728969ef8f7
Deleted: sha256:4a625c85559eacf4e5c992b34544683b72c2f46f8055e0a7799a56a23dbc4094
Deleted: sha256:473573a7503fe3b56d1814479b225776863413f8b60ab2e766c2ed36524e724d
Deleted: sha256:72452398af49ba6071960b6fe1df804a4eddbff99725426ab566956a31d75cf0
Deleted: sha256:013e9957f6c69508fed4a3715c38e3d9b9bccddec49eaf338ec1290ffca4f5be
Deleted: sha256:bd626b30da33c11e45452263cabd5bb37a44f5b504664541a9e6387402b7c5ba
Deleted: sha256:b97d82a2a21ffa00ff0add180bc41e28029e2aeed76ab380a3199ede58002a30
Deleted: sha256:500b74e7dd4b731538074f4c79ed4f7578fea3032c47a2abf5dcceae0669ba6b
Deleted: sha256:1c7bbe49623d24b332c89e4313c3d331cc18103a15d66c83fa31f22b9d414a97
Deleted: sha256:d22b6466406651f335d2eb650e61e7eb45c57d9345d9551c36c2707aa33e7f46
Deleted: sha256:0bffe0bf4154d8fabbe1c5ddc8d4e831d4c36851f112f98202e8a187be86e45b
Deleted: sha256:15473e7098399e54420067ca1387a98199562454e7db52b90a423b20974f53a6
Deleted: sha256:2a29cea7e9238906f6c78c562d20f92689ebff77c101412f4ff13f898977cceb
Deleted: sha256:62c9b1d8954260e1504c9fcc97e8c534ef4682ea3462dfc092f4ce35b7d677bb
Deleted: sha256:ded7a220bb058e28ee3254fbba04ca90b679070424424761a53a043b93b612bf
root@bluerose:/home/perlite# docker-compose build --no-cache
[+] Building 2.2s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                     0.0s
 => => transferring dockerfile: 197B                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/nginx:stable                                                                                                          1.7s
 => [internal] load build context                                                                                                                                        0.0s
 => => transferring context: 1.10kB                                                                                                                                      0.0s
 => CACHED [1/3] FROM docker.io/library/nginx:stable@sha256:9335f1c6d94691109184f04a7fdcb84b4f3b07904212e21a902c5d831f6d0486                                             0.0s
 => [2/3] RUN rm /etc/nginx/conf.d/default.conf                                                                                                                          0.3s
 => [3/3] COPY ./config/ /etc/nginx/conf.d/                                                                                                                              0.1s
 => exporting to image                                                                                                                                                   0.0s
 => => exporting layers                                                                                                                                                  0.0s
 => => writing image sha256:ae151c49c34a311f74caa5df01d255a1701b602aad7dcf2616f2182981330766                                                                             0.0s
 => => naming to docker.io/sec77/perlite_web:stable                                                                                                                      0.0s
root@bluerose:/home/perlite# docker-compose up
[+] Running 20/20
 ⠿ perlite Pulled                                                                                                                                                       20.3s
   ⠿ c158987b0551 Pull complete                                                                                                                                          3.4s
   ⠿ a2b6029f6920 Pull complete                                                                                                                                          4.4s
   ⠿ 55761811b31b Pull complete                                                                                                                                          4.4s
   ⠿ 9750fd99fe83 Pull complete                                                                                                                                          4.5s
   ⠿ 922c6c40febb Pull complete                                                                                                                                          6.7s
   ⠿ e02e22042c3b Pull complete                                                                                                                                          8.0s
   ⠿ 9bfb19a1a34f Pull complete                                                                                                                                          8.9s
   ⠿ 2121b2020d39 Pull complete                                                                                                                                          8.9s
   ⠿ f0544635a2c4 Pull complete                                                                                                                                          9.8s
   ⠿ d5d481ff0ba8 Pull complete                                                                                                                                         10.9s
   ⠿ bfba073e99e3 Pull complete                                                                                                                                         11.1s
   ⠿ 8bd7d03203a7 Pull complete                                                                                                                                         12.5s
   ⠿ fe2dcd3c5514 Pull complete                                                                                                                                         12.9s
   ⠿ 7710fea6203b Pull complete                                                                                                                                         13.0s
   ⠿ 017e4a9284d4 Pull complete                                                                                                                                         14.6s
   ⠿ 719b1c9ab110 Pull complete                                                                                                                                         14.6s
   ⠿ 1bf5c043b7fa Pull complete                                                                                                                                         14.8s
   ⠿ 7178afb0215d Pull complete                                                                                                                                         16.9s
   ⠿ 6bf220cbb77a Pull complete                                                                                                                                         17.3s
[+] Running 3/2
 ⠿ Network perlite_default  Created                                                                                                                                      0.0s
 ⠿ Container perlite        Created                                                                                                                                      0.1s
 ⠿ Container perlite_web    Created                                                                                                                                      0.0s
Attaching to perlite, perlite_web
perlite      | [11-Jan-2023 10:07:29] NOTICE: fpm is running, pid 1
perlite      | [11-Jan-2023 10:07:29] NOTICE: ready to handle connections
perlite_web  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
perlite_web  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
perlite_web  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
perlite_web  | /docker-entrypoint.sh: Configuration complete; ready for start up
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: using the "epoll" event method
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: nginx/1.22.1
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: OS: Linux 5.16.0-0.bpo.4-amd64
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker processes
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 20
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 21
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 22
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 23


root@bluerose:~# docker exec perlite_web ls -la '/etc/nginx/conf.d'
total 16
drwxr-xr-x 1 root root 4096 Jan 11 10:06 .
drwxr-xr-x 1 root root 4096 Jan 11 06:31 ..
-rw-r--r-- 1 root root 1022 Jan 11 09:59 perlite.conf
root@bluerose:~#

I think I'll have to look at the Nginx logs.

我认为你的配置仍然有问题 /etc/nginx/conf.d/default.conf differs from the packaged version

  1. 尝试使用 perlite.conf 而不是 default.conf
  2. CACHED [2/3]似乎有缓存的东西,也许这就是问题所在

请尝试以下操作:

  1. 停止所有珍珠岩容器
  2. 删除所有珍珠岩图像
docker image rm sec77/perlite_web:stable
docker image rm sec77/perlite:latest
  1. 确保 Repo 的 Perlite/web/config 目录中只有 perlite.conf
  2. 跑步docker-compose build --no-cache
  3. docker-compose up再次运行
  4. 仔细检查 perlite_web 容器中是否最终只有 perlite.conf
docker exec perlite_web ls -la '/etc/nginx/conf.d'

I've tried, but it doesn't work.I only modify docker-compose.yml.

 web:
    ports:
      - 11111:80

This is my logs:

root@bluerose:/home/perlite# docker-compose down
[+] Running 3/3
 ⠿ Container perlite_web-dev  Removed                                                                                                                                    0.4s
 ⠿ Container perlite          Removed                                                                                                                                    0.2s
 ⠿ Network perlite_default    Removed                                                                                                                                    0.2s
root@bluerose:/home/perlite# docker image rm sec77/perlite_web:stable
docker image rm sec77/perlite:latest
Untagged: sec77/perlite_web:stable
Deleted: sha256:bd23f3a959c0b63d308bf08afeaa233d28f4cfbfac9f899ae25b3ebc1b466115
Untagged: sec77/perlite:latest
Untagged: sec77/perlite@sha256:fc9297acbcac3e708a3f65def51a563bc1fdfe700db4865077b63bb0d5850f95
Deleted: sha256:a3a0d8bcd1375dedd529d01a9c51e91fb91349cd26bb308e71aa495cf172d2e7
Deleted: sha256:802fb331fdf0c96bff680a2e0841bbc43213d344d36308c5b06a40cceb345f26
Deleted: sha256:78f950eb31db8456ec44aed45417bfc128cbd51adc8d9b9d9203fbfbf14066c4
Deleted: sha256:b7355a7bb5b8ef3d121ed7c9b84048ffe6630b031fe83241ddf21667c3686443
Deleted: sha256:90004e2a86ec46f5c60a2f6445f52e48af4972e56c7f562f93f6f7e578d557e2
Deleted: sha256:05b1510ebd78f4b8542f654709371f44605794894694b9a6ec3ae728969ef8f7
Deleted: sha256:4a625c85559eacf4e5c992b34544683b72c2f46f8055e0a7799a56a23dbc4094
Deleted: sha256:473573a7503fe3b56d1814479b225776863413f8b60ab2e766c2ed36524e724d
Deleted: sha256:72452398af49ba6071960b6fe1df804a4eddbff99725426ab566956a31d75cf0
Deleted: sha256:013e9957f6c69508fed4a3715c38e3d9b9bccddec49eaf338ec1290ffca4f5be
Deleted: sha256:bd626b30da33c11e45452263cabd5bb37a44f5b504664541a9e6387402b7c5ba
Deleted: sha256:b97d82a2a21ffa00ff0add180bc41e28029e2aeed76ab380a3199ede58002a30
Deleted: sha256:500b74e7dd4b731538074f4c79ed4f7578fea3032c47a2abf5dcceae0669ba6b
Deleted: sha256:1c7bbe49623d24b332c89e4313c3d331cc18103a15d66c83fa31f22b9d414a97
Deleted: sha256:d22b6466406651f335d2eb650e61e7eb45c57d9345d9551c36c2707aa33e7f46
Deleted: sha256:0bffe0bf4154d8fabbe1c5ddc8d4e831d4c36851f112f98202e8a187be86e45b
Deleted: sha256:15473e7098399e54420067ca1387a98199562454e7db52b90a423b20974f53a6
Deleted: sha256:2a29cea7e9238906f6c78c562d20f92689ebff77c101412f4ff13f898977cceb
Deleted: sha256:62c9b1d8954260e1504c9fcc97e8c534ef4682ea3462dfc092f4ce35b7d677bb
Deleted: sha256:ded7a220bb058e28ee3254fbba04ca90b679070424424761a53a043b93b612bf
root@bluerose:/home/perlite# docker-compose build --no-cache
[+] Building 2.2s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                     0.0s
 => => transferring dockerfile: 197B                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/nginx:stable                                                                                                          1.7s
 => [internal] load build context                                                                                                                                        0.0s
 => => transferring context: 1.10kB                                                                                                                                      0.0s
 => CACHED [1/3] FROM docker.io/library/nginx:stable@sha256:9335f1c6d94691109184f04a7fdcb84b4f3b07904212e21a902c5d831f6d0486                                             0.0s
 => [2/3] RUN rm /etc/nginx/conf.d/default.conf                                                                                                                          0.3s
 => [3/3] COPY ./config/ /etc/nginx/conf.d/                                                                                                                              0.1s
 => exporting to image                                                                                                                                                   0.0s
 => => exporting layers                                                                                                                                                  0.0s
 => => writing image sha256:ae151c49c34a311f74caa5df01d255a1701b602aad7dcf2616f2182981330766                                                                             0.0s
 => => naming to docker.io/sec77/perlite_web:stable                                                                                                                      0.0s
root@bluerose:/home/perlite# docker-compose up
[+] Running 20/20
 ⠿ perlite Pulled                                                                                                                                                       20.3s
   ⠿ c158987b0551 Pull complete                                                                                                                                          3.4s
   ⠿ a2b6029f6920 Pull complete                                                                                                                                          4.4s
   ⠿ 55761811b31b Pull complete                                                                                                                                          4.4s
   ⠿ 9750fd99fe83 Pull complete                                                                                                                                          4.5s
   ⠿ 922c6c40febb Pull complete                                                                                                                                          6.7s
   ⠿ e02e22042c3b Pull complete                                                                                                                                          8.0s
   ⠿ 9bfb19a1a34f Pull complete                                                                                                                                          8.9s
   ⠿ 2121b2020d39 Pull complete                                                                                                                                          8.9s
   ⠿ f0544635a2c4 Pull complete                                                                                                                                          9.8s
   ⠿ d5d481ff0ba8 Pull complete                                                                                                                                         10.9s
   ⠿ bfba073e99e3 Pull complete                                                                                                                                         11.1s
   ⠿ 8bd7d03203a7 Pull complete                                                                                                                                         12.5s
   ⠿ fe2dcd3c5514 Pull complete                                                                                                                                         12.9s
   ⠿ 7710fea6203b Pull complete                                                                                                                                         13.0s
   ⠿ 017e4a9284d4 Pull complete                                                                                                                                         14.6s
   ⠿ 719b1c9ab110 Pull complete                                                                                                                                         14.6s
   ⠿ 1bf5c043b7fa Pull complete                                                                                                                                         14.8s
   ⠿ 7178afb0215d Pull complete                                                                                                                                         16.9s
   ⠿ 6bf220cbb77a Pull complete                                                                                                                                         17.3s
[+] Running 3/2
 ⠿ Network perlite_default  Created                                                                                                                                      0.0s
 ⠿ Container perlite        Created                                                                                                                                      0.1s
 ⠿ Container perlite_web    Created                                                                                                                                      0.0s
Attaching to perlite, perlite_web
perlite      | [11-Jan-2023 10:07:29] NOTICE: fpm is running, pid 1
perlite      | [11-Jan-2023 10:07:29] NOTICE: ready to handle connections
perlite_web  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
perlite_web  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
perlite_web  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
perlite_web  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
perlite_web  | /docker-entrypoint.sh: Configuration complete; ready for start up
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: using the "epoll" event method
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: nginx/1.22.1
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: OS: Linux 5.16.0-0.bpo.4-amd64
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker processes
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 20
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 21
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 22
perlite_web  | 2023/01/11 10:07:30 [notice] 1#1: start worker process 23


root@bluerose:~# docker exec perlite_web ls -la '/etc/nginx/conf.d'
total 16
drwxr-xr-x 1 root root 4096 Jan 11 10:06 .
drwxr-xr-x 1 root root 4096 Jan 11 06:31 ..
-rw-r--r-- 1 root root 1022 Jan 11 09:59 perlite.conf
root@bluerose:~#

I think I'll have to look at the Nginx logs.

commented

hmm Iam not sure if this cause the problem
perlite_web | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist

can you check if the your port is open on your host?

ss -tunlp should show something like this for you port

tcp               LISTEN             0                  511                                             [::]:8888                                    [::]:*

next I would check if you can access the site from your host

check if curl 127.0.0.1:8888 gives you something back

commented

you can check the nginx logs, but they already should redirect to your output if you run docker-compose without -d

use docker exec -it perlite_web /bin/sh to get a interactice session to you container
the logs are then here: /var/log/nginx

hmm Iam not sure if this cause the problem perlite_web | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist

can you check if the your port is open on your host?

ss -tunlp should show something like this for you port

tcp               LISTEN             0                  511                                             [::]:8888                                    [::]:*

next I would check if you can access the site from your host

check if curl 127.0.0.1:8888 gives you something back

After testing I think it's a Chrome problem.This is my testing result:

  1. ss -tunlp Show that the specified port is open.
  2. curl 127.0.0.1:8888 HTML data can be retrieved.
  3. Chrome Version 109.0.5414.75

Chrome show

This site can’t be reached
The webpage at http://192.168.50.166:6666/ might be temporarily down or it may have moved permanently to a new web address.
ERR_UNSAFE_PORT

But Internet can show any UI.So what browser do you use?

Wait,It's may my set port problem.

It's Work.Thank you @secure-77 .