-
Notifications
You must be signed in to change notification settings - Fork 61
/
Dockerfile
35 lines (26 loc) · 1.25 KB
/
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
33
34
35
ARG RUBY_VERSION=3.3.0
FROM ruby:$RUBY_VERSION-slim
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libvips gnupg2 curl git
# Ensure node.js 20 is available for apt-get
ARG NODE_MAJOR=20
RUN apt-get update && \
mkdir -p /etc/apt/keyrings && \
curl --fail --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
# Install node and yarn
RUN apt-get update -qq && apt-get install -y nodejs && npm install -g yarn
# Mount $PWD to this workdir
WORKDIR /rails
# Ensure gems are installed on a persistent volume and available as bins
# Make the folder world writable to let the default user install the gems
RUN mkdir /bundle && chmod -R ugo+rwt /bundle
VOLUME /bundle
ENV BUNDLE_PATH='/bundle'
ENV PATH="/bundle/ruby/$RUBY_VERSION/bin:${PATH}"
# Install Rails
RUN gem install rails
# Ensure binding is always 0.0.0.0, even in development, to access server from outside container
ENV BINDING="0.0.0.0"
# Overwrite ruby image's entrypoint to provide open cli
ENTRYPOINT [""]