3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rails6のDockerfileを書く

Last updated at Posted at 2019-12-26

rails5のDockerfileとdocker-compose.ymlを書く - Qiita
こちらのRails6バージョンです。

Dockerfile自体より6になったことでyarnが必要になり、さらにアップデートする必要があるところで時間がかかってしまいました。

Dockerfile

FROM ruby:2.6.5

RUN apt-get update -y && \
    apt-get install default-mysql-client nodejs npm -y && \
    gem install rails --version='6.0.1' && \
    npm uninstall yarn -g && \
    npm install yarn -g -y

COPY Gemfile /Gemfile
COPY Gemfile.lock /Gemfile.lock

RUN bundle install

参考サイト

Docker超入門という動画を作りました。 - Qiita
Docker超入門 Part1 - Qiita

Rails6 開発時につまづきそうな webpacker, yarn 関係のエラーと解決方法 - Qiita

yarn自体のアップグレードをする - Qiita

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?