-
Notifications
You must be signed in to change notification settings - Fork 132
Expand file tree
/
Copy pathDockerfile.dev
More file actions
75 lines (63 loc) · 2.47 KB
/
Copy pathDockerfile.dev
File metadata and controls
75 lines (63 loc) · 2.47 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
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM ruby:4.0.5
# Install system dependencies including Node.js
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential \
fontconfig \
git \
libpq-dev \
libyaml-dev \
postgresql-client \
libvips \
pkg-config \
curl \
tar \
nodejs \
npm \
woff2 \
chromium \
chromium-driver \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives
# Install Bun
RUN curl -fsSL https://bun.sh/install | bash && \
mv ~/.bun/bin/bun /usr/local/bin/
# Set working directory
WORKDIR /app
# Install npm dependencies for Vite.
COPY package.json bun.lock ./
COPY patches patches
RUN bun install
# Make Spline Sans available to librsvg/libvips via fontconfig. Pango does not
# rasterize the bundled WOFF2 reliably, so dev installs a converted TTF.
RUN cp /app/node_modules/@fontsource-variable/spline-sans/files/spline-sans-latin-wght-normal.woff2 /tmp/spline-sans-latin-wght-normal.woff2 && \
woff2_decompress /tmp/spline-sans-latin-wght-normal.woff2 && \
install -Dm644 /tmp/spline-sans-latin-wght-normal.ttf \
/usr/local/share/fonts/spline-sans/spline-sans-latin-wght-normal.ttf && \
fc-cache -f /usr/local/share/fonts/spline-sans
# Install application dependencies
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Rebuild native extensions for default gems that ship without compiled
# extensions in the base image. Without this, Bundler floods every command
# with "Source locally installed gems is ignoring..." warnings.
RUN gem pristine --extensions json erb bigdecimal rdoc
# The base image can ship rdoc in the default gem path with a rubygems plugin
# that auto-loads on every gem/bundler invocation. The Gemfile also resolves
# rdoc, so both copies can be required and emit "already initialized constant"
# warnings. Removing the default-path copy leaves only the bundled rdoc.
RUN gem uninstall -i "$(ruby -e 'print Gem.default_dir')" -I -x rdoc --all || true
# Add a script to be executed every time the container starts
COPY entrypoint.dev.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.dev.sh
ENTRYPOINT ["entrypoint.dev.sh"]
# Global git safeguards
RUN git config --system http.timeout 30 && \
git config --system http.lowSpeedLimit 1000 && \
git config --system http.lowSpeedTime 10
EXPOSE 3000
EXPOSE 3036
# Disable dev warnings
RUN bundle exec skylight disable_dev_warning
RUN bundle config set default_cli_command install --global
# Start the main process
CMD ["rails", "server", "-b", "0.0.0.0"]