我的第一個真正的網站開發,所以請耐心等待。我有一個 yml 檔案,我用它來啟動 docker-compose。這是在數字海洋水滴上運行的,并且站點名稱已鏈接到它
version: "3.2"
services:
httpd:
image: httpd:2.4.46-alpine
ports:
- 8080:80
volumes:
- type: bind
source: ./main/
target: /usr/local/apache2/htdocs/
主檔案夾結構如下所示,index.html 是一個簡單的 html 頁面,其中包含對包含其他 html 頁面的 nj 和 oh 目錄的參考

我運行 docker compose 和這個 yml 檔案和 sitename.com:8080 是 index.html 加載到而不是 sitename.com
uj5u.com熱心網友回復:
如果你想訪問你的站點而不在 URL 中指定埠號,你應該系結你的主機埠 80 而不是 8080。這樣你就不需要指定埠,因為 80 是默認值。
在你的例子中:
ports:
- 80:80
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/382101.html
