-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.dev
More file actions
50 lines (41 loc) · 1.05 KB
/
Dockerfile.dev
File metadata and controls
50 lines (41 loc) · 1.05 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
# Use Ruby 3.x with Alpine as base image for smaller size
FROM ruby:4.0.1-alpine
# Set environment variables for Rails
ENV RAILS_ENV=development \
RACK_ENV=development \
BUNDLE_PATH=/usr/local/bundle \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=3
# Install system dependencies and development tools
RUN apk add --no-cache \
build-base \
postgresql-dev \
yaml-dev \
git \
tzdata \
bash \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
chromium \
chromium-chromedriver \
libffi-dev
# Set Chrome environment variables
ENV CHROME_BIN=/usr/bin/chromium-browser \
CHROME_PATH=/usr/lib/chromium/
# Create and set working directory
WORKDIR /app
# Install Ruby dependencies
COPY Gemfile Gemfile.lock ./
RUN bundle install
# Add bind mount point for code
VOLUME /app
# Port used by Rails server
EXPOSE 3000
# Configure entrypoint to run Rails
ENTRYPOINT ["./bin/docker-entrypoint.dev"]
# Start Rails server by default
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]