-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (24 loc) · 998 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 the official Ruby 3.3.0 Alpine image as the base image
FROM ruby:3.3.0-alpine
# Set the working directory to /shipyrd
WORKDIR /shipyrd
# Copy the Gemfile, shipyrd.gemspec into the container
COPY Gemfile shipyrd.gemspec ./
# Required in shipyrd.gemspec
COPY lib/shipyrd/version.rb /shipyrd/lib/shipyrd/version.rb
# Install system dependencies
RUN apk add --no-cache --update build-base git \
&& gem install bundler --version=2.5.14 \
&& bundle install
# Copy the rest of our application code into the container.
# We do this after bundle install, to avoid having to run bundle
# every time we do small fixes in the source code.
COPY . .
# Install the gem locally from the project folder
RUN gem build shipyrd.gemspec && \
gem install ./shipyrd-*.gem --no-document
# Set the working directory to /workdir
WORKDIR /workdir
# Tell git it's safe to access /workdir/.git even if
# the directory is owned by a different user
RUN git config --global --add safe.directory /workdir