我使用以下命令安装了 ColdFusion 的 Docker 版本:
docker pull eaps-docker-coldfusion.bintray.io/cf/coldfusion:latest
然后我创建了一个撰写文件:
version: "3.7"
services:
coldfusion:
image: eaps-docker-coldfusion.bintray.io/cf/coldfusion:latest
ports:
- "8500:8500"
networks:
coldfusion:
hostname: coldfusion
volumes:
- "~/dev/docker/projects/coldfusion/volumes/app:/app"
- "~/dev/docker/projects/coldfusion/volumes/logs:/opt/coldfusion/cfusion/logs"
environment:
acceptEULA: "YES"
password: "ColdFusion123"
enableSecureProfile: "false"
HOST_USER_ID: ${CURRENT_UID}
HOST_GROUP_ID: ${CURRENT_GID}
deploy:
replicas: 1
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 10s
healthcheck:
test: curl --fail http://localhost:8500 || exit 1
interval: 1m
timeout: 3s
retries: 3
networks:
coldfusion:
name: coldfusion
common:
external: true
name: common
并用以下命令启动:
docker stack deploy --compose-file docker-compose-dev.yml coldfusion
日志显示:
stephane@stephane-pc:~/dev/docker/projects/coldfusion$ docker service logs -f coldfusion_coldfusion
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Updating webroot to /app
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Configuring virtual directories
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Updating password
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Skipping language updation
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Serial Key: Not Provided
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Previous Serial Key: Not Provided
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Starting ColdFusion
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Starting ColdFusion 2018 server ...
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | The ColdFusion 2018 server is starting up and will be available shortly.
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | ======================================================================
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | ColdFusion 2018 server has been started.
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | ColdFusion 2018 will write logs to /opt/coldfusion/cfusion/bin/../logs/coldfusion-out.log
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | ======================================================================
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | [000] Checking server startup status...
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | % Total % Received % Xferd Average Speed Time Time Time Current
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | External Addons: Disabled
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | External Session Storage: Disabled
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Skipping setup script invocation
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Secure Profile: Disabled
coldfusion_coldfusion.1.rlhixv3jctvm@stephane-pc | Cleaning up setup directories
但是在浏览器中键入 http://localhost:8500/
请求时它会挂起。
日志保持为空:
tail -f volumes/logs/coldfusion-out.log
我在 /app
目录中创建了一个 index.cfm
页面:
hi
<cfset firstName = "World">
Hello <cfoutput>#firstName#</cfoutput>!
This CFML tutorial was designed for
<cfif firstName eq "World">
you!
<cfelse>
the world to see.
</cfif>
更新:当使用127.0.0.1
而不是localhost
时,200响应返回正常
打开防火墙端口不会改变问题的任何方面:
stephane@stephane-pc:~$ sudo ufw allow from 127.0.0.0 to any port 8500;
Rules updated
stephane@stephane-pc:~$ sudo ufw allow from any to any port 8500;
Rules updated
Rules updated (v6)
我的host/etc/host
文件包含以下行:
127.0.0.1 localhost
nmap
命令响应:
stephane@stephane-pc:~/dev/docker/projects/coldfusion$ nmap -p 8500 localhost
Starting Nmap 7.80 ( https://nmap.org ) at 2020-09-08 12:09 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00038s latency).
PORT STATE SERVICE
8500/tcp open fmtp
Nmap done: 1 IP address (1 host up) scanned in 0.22 seconds
您的docker撰写文件显示
hostname: coldfusion
那么它不应该在超文本传输协议://coldFusion: 8500上可用吗?
如果是docker compose v3,应该是
services:
dns:
hostname: 'your-domain'