-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
35 lines (27 loc) · 960 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
33
34
35
# 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 USER_LOGIN
ARG OPENAI_TOKEN
# Set environment variables
ENV DATABASE_URL=$DATABASE_URL
ENV ACCESS_TOKEN=$ACCESS_TOKEN
ENV USER_LOGIN=$USER_LOGIN
ENV OPENAI_TOKEN=$OPENAI_TOKEN
# Copy the Gemfile and Gemfile.lock
COPY . .
# Install dependencies
RUN bundle config set --local without 'development test' && \
bundle install --jobs $(nproc) --retry 10 && \
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!"