Skip to content

Commit 59d0343

Browse files
committed
Add Dockerfile
1 parent 89c2954 commit 59d0343

4 files changed

Lines changed: 71 additions & 10 deletions

File tree

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-3.2.2
1+
ruby-3.4.4

Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# syntax = docker/dockerfile:1
2+
3+
ARG RUBY_VERSION=3.4.4
4+
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base
5+
6+
WORKDIR /rails
7+
8+
ENV SECRET_KEY_BASE_DUMMY=1
9+
10+
# Set environment variables
11+
ENV RAILS_ENV="production" \
12+
BUNDLE_PATH="/usr/local/bundle" \
13+
LANG="C.UTF-8" \
14+
RAILS_LOG_TO_STDOUT="enabled"
15+
16+
# Throw-away build stage
17+
FROM base AS build
18+
19+
# Install packages needed to build gems
20+
RUN apt-get update -qq && \
21+
apt-get install --no-install-recommends -y \
22+
build-essential \
23+
git \
24+
pkg-config \
25+
libsecp256k1-dev \
26+
libssl-dev \
27+
libyaml-dev \
28+
zlib1g-dev \
29+
automake \
30+
autoconf \
31+
libtool && \
32+
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
33+
34+
# Install application gems
35+
COPY Gemfile Gemfile.lock ./
36+
RUN bundle config build.rbsecp256k1 --use-system-libraries && \
37+
bundle install --jobs 4 --retry 3
38+
39+
# Copy application code and precompile bootsnap
40+
COPY . .
41+
ENV BOOTSNAP_COMPILE_CACHE_THREADS=4
42+
RUN bundle exec bootsnap precompile app/ lib/
43+
44+
# Final stage
45+
FROM base
46+
47+
# Install only runtime dependencies
48+
RUN apt-get update -qq && \
49+
apt-get install --no-install-recommends -y \
50+
libsecp256k1-dev \
51+
libyaml-0-2 && \
52+
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
53+
54+
# Copy built artifacts
55+
COPY --from=build /usr/local/bundle /usr/local/bundle
56+
COPY --from=build /rails /rails
57+
58+
# Set up non-root user
59+
RUN useradd rails --create-home --shell /bin/bash && \
60+
chown -R rails:rails log tmp
61+
USER rails:rails
62+
63+
CMD ["bundle", "exec", "clockwork", "config/derive_ethscriptions_blocks.rb"]

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
ruby "3.2.2"
3+
ruby "3.4.4"
44

55
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
66
gem "rails", "~> 7.1.2"

Gemfile.lock

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ GIT
1616

1717
GIT
1818
remote: https://github.com/0xfacet/facet_rails_common.git
19-
revision: dd72807b5e51dc6fd7969f320cbb9bedfa92c4a5
19+
revision: 2d5cf107df9ea12bb7ab59a8b1ce4d38b4de483b
2020
specs:
2121
facet_rails_common (0.1.0)
2222
order_query (~> 0.5.3)
@@ -73,7 +73,7 @@ GEM
7373
erubi (~> 1.11)
7474
rails-dom-testing (~> 2.2)
7575
rails-html-sanitizer (~> 1.6)
76-
active_record_query_trace (1.8.2)
76+
active_record_query_trace (1.8.3)
7777
activerecord (>= 6.0.0)
7878
activejob (7.1.2)
7979
activesupport (= 7.1.2)
@@ -218,11 +218,8 @@ GEM
218218
net-protocol
219219
netrc (0.11.0)
220220
nio4r (2.7.0)
221-
nokogiri (1.15.5-aarch64-linux)
222-
racc (~> 1.4)
223-
nokogiri (1.15.5-arm64-darwin)
224-
racc (~> 1.4)
225-
nokogiri (1.15.5-x86_64-linux)
221+
nokogiri (1.15.5)
222+
mini_portile2 (~> 2.8.2)
226223
racc (~> 1.4)
227224
oj (3.16.11)
228225
bigdecimal (>= 3.0)
@@ -391,6 +388,7 @@ PLATFORMS
391388
aarch64-linux
392389
arm64-darwin-20
393390
arm64-darwin-22
391+
arm64-darwin-24
394392
x86_64-linux
395393

396394
DEPENDENCIES
@@ -439,7 +437,7 @@ DEPENDENCIES
439437
tzinfo-data
440438

441439
RUBY VERSION
442-
ruby 3.2.2p53
440+
ruby 3.4.4p34
443441

444442
BUNDLED WITH
445443
2.4.14

0 commit comments

Comments
 (0)