如何使用 Docker 为 Heroku 部署更改 "remote process types"
How to change "remote process types" for Heroku deploy with Docker
我正在将 docker
容器部署到 Heroku
并部署了不正确的 remote process types
。我不确定为什么会这样...
我的Procfile
是:
web: python app.py
我的 docker-compose.yml
文件是:
web:
build: .
command: python app.py
working_dir: /app
environment:
PORT: 8080
ports:
- '8080:5000'
shell:
build: .
command: bash
working_dir: /app
environment:
PORT: 8080
ports:
- '8080:5000'
volumes:
- '.:/app'
出于某种原因,当我使用 heroku docker:release
进行部署时,我得到:
Remote addons: (0) Local addons: (0) Missing addons: (0) Creating local slug... Building web Step 1 : FROM t206cv:latest ---> af69b4ac9de8
Successfully built af69b4ac9de8
extracting slug from container...
creating remote slug...
language-pack: heroku-docker (t206cv:latest)
remote process types: { web: 'cd /app/user && python app.py' }
uploading slug [====================] 100% of 127 MB, 0.0s
releasing slug...
Successfully released still-depths-21391!
我该如何改变
remote process types: { web: 'cd /app/user && python app.py' }
到
remote process types: { web: 'cd /app && python app.py' }
docs 似乎表明 docker-compose.yml
和 Dockerfile
都是从 app.json
文件生成的,当您 运行 时:heroku docker:init
。
/app/user
路径可能在那里,并且可能是更改的最佳位置(然后再次 运行 heroku docker:init
)。
或者,此路径可能在 Dockerfile
中,只需更改它(以及您的 .yml 文件)可能会解决您的问题。
编辑:
看起来 app/user
目录在 heroku-docker 中被硬编码,它本身在 directory.js
中。看起来很奇怪,但这可能是您唯一可以更改的地方。
...并且似乎也在 docker.js 中进行了硬编码,这似乎是生成的 docker-compose.yml 文件的来源。
我正在将 docker
容器部署到 Heroku
并部署了不正确的 remote process types
。我不确定为什么会这样...
我的Procfile
是:
web: python app.py
我的 docker-compose.yml
文件是:
web:
build: .
command: python app.py
working_dir: /app
environment:
PORT: 8080
ports:
- '8080:5000'
shell:
build: .
command: bash
working_dir: /app
environment:
PORT: 8080
ports:
- '8080:5000'
volumes:
- '.:/app'
出于某种原因,当我使用 heroku docker:release
进行部署时,我得到:
Remote addons: (0) Local addons: (0) Missing addons: (0) Creating local slug... Building web Step 1 : FROM t206cv:latest ---> af69b4ac9de8
Successfully built af69b4ac9de8
extracting slug from container...
creating remote slug...
language-pack: heroku-docker (t206cv:latest)
remote process types: { web: 'cd /app/user && python app.py' }
uploading slug [====================] 100% of 127 MB, 0.0s
releasing slug...
Successfully released still-depths-21391!
我该如何改变
remote process types: { web: 'cd /app/user && python app.py' }
到
remote process types: { web: 'cd /app && python app.py' }
docs 似乎表明 docker-compose.yml
和 Dockerfile
都是从 app.json
文件生成的,当您 运行 时:heroku docker:init
。
/app/user
路径可能在那里,并且可能是更改的最佳位置(然后再次 运行 heroku docker:init
)。
或者,此路径可能在 Dockerfile
中,只需更改它(以及您的 .yml 文件)可能会解决您的问题。
编辑:
看起来 app/user
目录在 heroku-docker 中被硬编码,它本身在 directory.js
中。看起来很奇怪,但这可能是您唯一可以更改的地方。
...并且似乎也在 docker.js 中进行了硬编码,这似乎是生成的 docker-compose.yml 文件的来源。