-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
32 lines (25 loc) · 922 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
31
32
# Use an Ubuntu-based Ruby image
FROM ruby:3.2-buster
# Set the working directory
WORKDIR /
# Install MySQL client and development libraries
RUN apt-get update -qq && \
apt-get install -y default-mysql-client default-libmysqlclient-dev ca-certificates
# Set argument variables
ARG DATABASE_URL
ARG ACCESS_TOKEN
ARG REPO_FULL_NAME
# Set environment variables
ENV DATABASE_URL=$DATABASE_URL
ENV ACCESS_TOKEN=$ACCESS_TOKEN
ENV REPO_FULL_NAME=$REPO_FULL_NAME
# Copy the Gemfile and Gemfile.lock
COPY . .
# Install dependencies
RUN bundle config set --local without 'development test' && \
bundle install --jobs $(nproc) --retry 3 && \
rm -rf /usr/local/bundle/cache/*.gem
# Run the migration and sync GitHub Repo Data scripts
CMD ls && pwd && bundle exec rails runner "RetryableRake.db_create" && \
bundle exec rails runner "RetryableRake.db_migrate" && \
bundle exec rails runner "SyncGithub.run!"