-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.dbmigrate
28 lines (20 loc) · 1.01 KB
/
Dockerfile.dbmigrate
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
# https://docs.docker.com/compose/rails/
FROM ruby:3.0
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
RUN apt update -qq && apt install -y nodejs default-mysql-client google-cloud-sdk && rm -rf /var/lib/apt/lists/*
RUN npm install -g yarn
RUN gem install bundler -v 2.2.26
WORKDIR /app
COPY ./Gemfile /app/Gemfile
COPY ./Gemfile.lock /app/Gemfile.lock
RUN bundle _2.2.26_ install
COPY ./package.json /app/package.json
COPY ./yarn.lock /app/yarn.lock
RUN yarn install --pure-lockfile
ARG PROJECT_ID
COPY GCP_SA_KEY.json /app/GCP_SA_KEY.json
RUN gcloud config set project $PROJECT_ID && gcloud auth activate-service-account --key-file GCP_SA_KEY.json
COPY . /app
CMD rails "appengine:exec[bundle exec rails db:migrate]"