【发布时间】:2019-09-18 10:37:57
【问题描述】:
docker 新手,我一直在尝试将它与我的 rails 项目一起使用,但无法启动它。
尝试更改 ruby 版本并搜索网络,但大多数问题涉及将应用程序部署到 heroku,这不是我的情况。
Docker 文件:
FROM ruby:2.4.1
RUN mkdir /zssn
WORKDIR /zssn
COPY Gemfile /zssn/Gemfile
COPY Gemfile.lock /zssn/Gemfile.lock
RUN gem install bundler
RUN bundle --version
RUN bundle install
COPY . /zssn
CMD ["rails", "server"]
docker-compose-yml
version: '3'
services:
web:
build: .
command: rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/zssn
ports:
- "3000:3000"
码头工人建造。 --no-cache,在运行 bundler 命令安装它时似乎工作正常。
---> Running in d4650608f428
Successfully installed bundler-2.0.1
有什么想法吗?
【问题讨论】:
标签: ruby-on-rails ruby docker docker-compose dockerfile