forked from rubyforgood/stocks-in-the-future
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
35 lines (28 loc) · 1 KB
/
Dockerfile.dev
File metadata and controls
35 lines (28 loc) · 1 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
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.4.4
FROM ruby:$RUBY_VERSION-slim as base
# Rails app lives here
WORKDIR /rails
# Install packages needed to build gems
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential libpq-dev curl \
nodejs npm libyaml-dev git \
chromium chromium-driver # Add these packages \
build-essential libpq-dev curl \
nodejs npm libyaml-dev git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g yarn
COPY Gemfile Gemfile.lock ./
# Install gems - ensure we install all groups
RUN gem update --system && \
gem install bundler && \
bundle config set --local without '' && \
bundle install --jobs 20 --retry 5
COPY . .
RUN SECRET_KEY_BASE=placeholder bundle exec rails assets:precompile
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD ["./bin/rails", "server", "-b", "0.0.0.0"]