Skip to content

[Bug][docker] .env file PORT unused in docker image settings #278

@edwardzcn-decade

Description

@edwardzcn-decade

Description

Following the quick start steps in README, copy the .env file and modify PORT=5060 (since local port 5000 is already occupied).

However, after running docker compose up -d, BettaFish container still exposes port 5000. Does the .env file work for docker (I guess so because it cant set up without touch this file)? Here is the log:

2025-11-10 02:40:43.292 | INFO     | __main__:<module>:1036 - Flask服务器已启动,访问地址: [http://0.0.0.0:5000⁠](http://0.0.0.0:5000/)

Expected behavior

Container should respect .env → PORT value and expose the configured port (e.g., 5060).

Actual behavior

Container continues to expose default port 5000, ignoring .env override PORT=5060.

I will try building it locally.

问题描述

复制 .env 文件并修改其中的 PORT=5060(因为本地的 5000 端口常被占用)。

执行 docker compose up -d 后,BettaFish 容器仍然暴露的是 5000 端口。.env 文件是否对 Docker 生效?(我感觉是的,缺失它容器无法正常启动)。以下是日志输出:

2025-11-10 02:40:43.292 | INFO     | __main__:<module>:1036 - Flask服务器已启动,访问地址: [http://0.0.0.0:5000⁠](http://0.0.0.0:5000/)

预期行为

容器应当读取 .env 文件中的 PORT 参数,并按照配置的端口(例如 5060)进行暴露。

实际行为

容器仍然暴露默认的 5000 端口,忽略了 .env 中的 PORT=5060 配置。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions