Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Gemfile & Dockerfile to get passing tests #1732

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gemfile.lock
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

ENV BUNDLER_VERSION=2.5.11
RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force

WORKDIR /srv

COPY Gemfile doorkeeper.gemspec /srv/
COPY lib/doorkeeper/version.rb /srv/lib/doorkeeper/version.rb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, I tried hacking this whilst working on #1735 and didn't quite get it right, I was doing:

 COPY Gemfile Gemfile.lock doorkeeper.gemspec lib/doorkeeper/version.rb /srv/

And it was failing to load the version file; I guess this explains why!


# This is a fix for sqlite alpine issues
RUN bundle config force_ruby_platform true
RUN bundle install

COPY . /srv/

RUN chown -R doorkeeper:doorkeeper /srv
RUN chown -R doorkeeper:doorkeeper /srv/coverage /srv/spec/dummy/tmp /srv/spec/generators/tmp

# Set the running user for resulting container
USER doorkeeper

RUN mkdir -p /srv/.local/gem/share
ENV GEM_HOME=/srv/.local/gem/share

ENV BUNDLER_VERSION=2.5.11
RUN gem install bundler -v ${BUNDLER_VERSION}

# This is a fix for sqlite alpine issues
RUN bundle config force_ruby_platform true
RUN bundle install

CMD ["bundle", "exec", "rake"]
CMD ["rake"]