-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (51 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
64 lines (51 loc) · 1.45 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# syntax=docker/dockerfile:1
ARG RUBY_VERSION=3.3.7
FROM ruby:${RUBY_VERSION}-slim AS base
ENV BUNDLE_WITHOUT="development:test"
ENV RAILS_LOG_TO_STDOUT=true \
RAILS_SERVE_STATIC_FILES=true \
RACK_ENV=production \
RAILS_ENV=production \
BUNDLE_DEPLOYMENT=1 \
APP_HOME=/app
# Optional: install Chromium for headless browser scraping
ARG INSTALL_CHROMIUM=false
WORKDIR ${APP_HOME}
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
ca-certificates \
pkg-config \
libpq-dev \
libyaml-dev \
libglib2.0-0 \
libglib2.0-dev \
libvips \
libvips-dev \
libheif-dev \
libpoppler-glib8 \
procps \
shared-mime-info \
ffmpeg \
tzdata \
&& if [ "$INSTALL_CHROMIUM" = "true" ]; then \
apt-get install -y --no-install-recommends chromium; \
fi \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
# Install gems first (leverage layer caching)
COPY Gemfile Gemfile.lock ./
RUN gem update --system && \
gem install bundler -v 2.4.14 && \
bundle install --jobs=4 --retry=3
# Copy application code
COPY . .
# Ensure entrypoint is executable
RUN chmod +x bin/docker-entrypoint
# Skip asset precompilation at build time
# Rails will compile assets on demand with config.assets.compile = true
EXPOSE 3000
ENTRYPOINT ["bin/docker-entrypoint"]
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]