-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (27 loc) · 993 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM ruby:2.7.1
ENV LANG C.UTF-8
ENV APP_ROOT /usr/src
WORKDIR $APP_ROOT
RUN set -ex && \
apt-get update -qq && \
apt-get install -y sudo && \
: "Install node.js" && \
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \
apt-get update -qq && \
apt-get install -y nodejs && \
: "Install yarn" && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
apt-get update -qq && \
apt-get install -y yarn && \
: "Install rails6.X latest version" && \
gem install rails --version="~>6.0.0"
ADD Gemfile $APP_ROOT/Gemfile
ADD Gemfile.lock $APP_ROOT/Gemfile.lock
RUN gem install bundler:2.1.4 &&\
bundle install &&\
yarn install &&\
rails db:create &&\
rails db:migrate
# MEMO: docker exec -it rails_web /bin/bash
# MEMO: ./config/database.ymlを password: root, host: db に書き換え