首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >将docker容器部署到heroku

将docker容器部署到heroku
EN

Stack Overflow用户
提问于 2017-08-28 00:32:14
回答 1查看 3.4K关注 0票数 3

我在本地使用docker composer构建了一个web应用程序。Docker composers有多个服务,而这些服务又有各自的dockerfile,如下所示:

代码语言:javascript
复制
version: '2'
services:

  # The Application
  app:
    build:
      context: ./
      dockerfile: app.dockerfile
    working_dir: /var/www
    volumes:
      - ./:/var/www
    environment:
      - "DB_PORT=3306"
      - "DB_HOST=database"

  # The Web Server
  web:
    build:
      context: ./
      dockerfile: web.dockerfile
    working_dir: /var/www
    volumes_from:
      - app
    ports:
      - 9002:80

  # The Database
  database:
    image: mysql:5.6
    volumes:
      - dbdata:/var/lib/mysql
    environment:
      - "MYSQL_ROOT_PASSWORD=****"
      - "MYSQL_DATABASE=****"
      - "MYSQL_USER=***"
    ports:
        - "33061:3306"

  #Cache
  memcached:
    image: memcached
    ports:
        - "11211:11211"
    mem_limit: 1g
    command: memcached -m 1024m

volumes:
  dbdata:

如何将我的应用程序部署到heroku?可以使用docker编写文件来完成吗?或者我需要建立一个镜像。我是heroku的新手。请帮帮忙。

更新:下面是我的docker images命令的输出:

代码语言:javascript
复制
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
<none>               <none>              dbdc39e8d1ae        36 hours ago        415MB
<none>               <none>              6e6ebf3dc133        36 hours ago        559MB
simplesms_app        latest              d43e46560ed8        46 hours ago        761MB
simplesms_web        latest              d1923872bf33        2 days ago          182MB
<none>               <none>              715ac76296bf        2 days ago          756MB
php                  7-apache            a47f065418d5        3 weeks ago         391MB
php                  7.0-apache          a47f065418d5        3 weeks ago         391MB
runwaytest_web       latest              a47f065418d5        3 weeks ago         391MB
php                  7.0-fpm             62e3017b4758        3 weeks ago         380MB
nginx                latest              b8efb18f159b        4 weeks ago         107MB
mysql                5.6                 cdfa8cc50c33        4 weeks ago         298MB
mysql                5.7                 c73c7527c03a        4 weeks ago         412MB
mysql                latest              c73c7527c03a        4 weeks ago         412MB
memcached            latest              0b0366c7c206        4 weeks ago         58.6MB
hello-world          latest              1815c82652c0        2 months ago        1.84kB
nginx                1.10                0346349a1a64        5 months ago        182MB
startx/sv-memcache   latest              706858567fa8        10 months ago       253MB
php                  7.0.5-fpm           e6673411c12c        16 months ago       501MB
php                  7.0.4-fpm           81d7a2fdc6dc        17 months ago       494MB
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45907064

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档