Heroku运行2个容器

时间:2018-01-24 19:59:40

标签: ruby-on-rails docker heroku heroku-toolbelt icecast

我正在尝试使用heroku容器推送2个容器:推送网络。 1是我的rails,sidekiq项目与dockerfile:

FROM ruby:2.4.3

ENV DEBIAN_FRONTEND noninteractive
ENV BUILD_PACKAGES curl-dev build-base
RUN apt-get update
RUN apt-get install -y libpq-dev git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev 
RUN apt-get install -y apt-utils

RUN wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
  apt-key add -
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq \
    && apt-get install -y --no-install-recommends \
  postgresql-client-9.6 \
&& rm -rf /var/lib/apt/lists/*t
# Node.js
RUN apt-get install -y nodejs

# for nokogiri
RUN apt-get install -y libxml2-dev libxslt1-dev


# for capybara-webkit
RUN apt-get install -y libqt4-webkit libqt4-dev xvfb


#For Ruby-shout
RUN apt-get install -y libxml2 libxslt1-dev python-dev
RUN apt-get update && apt-get install -y \
curl
RUN apt-get install -y vorbis-tools
RUN apt-get install -y libshout3-dev 





# Install foreman
RUN gem install foreman


RUN rm -rf /var/lib/gems/2.4.1/cache/*
#ICECAST DEPENDENCY INSTALL REDIS+DEPENDENCY ICECAST
#RUN apt-get install -y redis-server
#RUN redis-server --daemonize yes
# RUN redis-server --version
RUN mkdir /app

WORKDIR /app

COPY /src /app



RUN gem install bundler
RUN gem install rake
RUN bundle install
EXPOSE 3000
EXPOSE 35689
RUN bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e production -q radioworker
RUN bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml -e production -q testworker
CMD bundle exec puma -C config/puma.rb 

和一个冰球容器:

FROM centos:7
MAINTAINER "John Smith" <your@email.com>

RUN yum -y update && yum clean all
RUN yum -y install wget
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install epel-release-latest-7.noarch.rpm
RUN yum -y install icecast
ADD ./etc/ /etc/
RUN sed -ri "s/<bind-address>127.0.0.1<\/bind-address>/<bind-address>0.0.0.0<\/bind-address>/g" /etc/icecast.xml
CMD sed -ri "s/<port>8000<\/port>/<port>$PORT<\/port>/g" /etc/icecast.xml && /bin/icecast -c /etc/icecast.xml

我有2个运行heroku应用程序都使用他们受尊敬的容器,但是如果我尝试将它们都推送到1个heroku应用程序:其中1个dynos设置为off并收到错误消息:

2018-01-24T19:52:32.583213+00:00 app[web.1]:   /usr/local/bundle/gems/puma-3.11.0/lib/puma/single.rb:87:in `run'

2018-01-24T19:52:32.583210+00:00 app[web.1]:   /usr/local/bundle/gems/puma-3.11.0/lib/puma/configuration.rb:318:in `load_rackup'

2018-01-24T19:52:32.583215+00:00 app[web.1]:   /usr/local/bundle/gems/puma-3.11.0/lib/puma/cli.rb:77:in `run'

2018-01-24T19:52:32.583211+00:00 app[web.1]:   /usr/local/bundle/gems/puma-3.11.0/lib/puma/configuration.rb:243:in `app'

2018-01-24T19:52:32.583214+00:00 app[web.1]:   /usr/local/bundle/gems/puma-3.11.0/lib/puma/launcher.rb:183:in `run'

2018-01-24T19:52:32.583216+00:00 app[web.1]:   /usr/local/bundle/gems/puma-3.11.0/bin/puma:10:in `<top (required)>'

2018-01-24T19:52:32.583217+00:00 app[web.1]:   /usr/local/bundle/bin/puma:29:in `load'

2018-01-24T19:52:32.583218+00:00 app[web.1]:   /usr/local/bundle/bin/puma:29:in `<top (required)>'

2018-01-24T19:52:32.758777+00:00 heroku[web.1]: State changed from starting to crashed

2018-01-24T19:52:32.744630+00:00 heroku[web.1]: Process exited with status 1

2018-01-24T19:55:13.615672+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mysterious-journey-25544.herokuapp.com request_id=dcc3647b-a42e-4f14-9ff4-e4667497f1a7 fwd="5.53.181.93" dyno= connect= service= status=503 bytes= protocol=http

我的dynos显示为:https://imgur.com/a/IHlSkhttps://imgur.com/a/QMKeO(尝试将icecast容器设置为此处的工作人员(未更改任何内容)

0 个答案:

没有答案