Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
gotify:
image: "gotify/server:2.6.0"
image: "gotify/server:2.6.1"
container_name: ${CONTAINER_NAME}
restart: always
networks:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该代码中可能存在一些问题:

  1. 在版本号上存在拼写错误, 应为"2.6.0"而不是“2.6.0”。正确的应该修改为image: "gotify/server:2.6.0"

    整改后的正确代码应如下所示:

services:
  goneitfy:
    image: "gotify/goneitfy:2.6.0" 
  1. 暂时性停用docker网络。

    如果需要将这个应用部署到不同的Docker容器上, 需要创建相应的Docker network,并确保每个服务容器都能够连接和使用该网络。否则可能会出现通信中断的情况。

  2. 容器名称应该是大写字母开头小写字母结尾且遵循英文命名标准(如 my-app-container) ,以避免在操作系统级冲突。

    更新过的code示例:

   containers:
     myapp-container:
       image: nginx
        restart_policy:
          name: always
         ports:
           - '80:80'
           - '443:443'
      main-container:
         image: nginx
         restart_policy: always
         volumes_from:
             - myapp-container

            networks:
              - db_network # 创建一个独立于nginx的network
           ports:
             - '80:80'            

Expand Down