-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile.analysis
More file actions
37 lines (28 loc) · 870 Bytes
/
Dockerfile.analysis
File metadata and controls
37 lines (28 loc) · 870 Bytes
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
# Use a base image with Ruby, version set by ARG (default: 3.2)
ARG RUBY_VERSION=3.2
FROM ruby:$RUBY_VERSION
# Set environment variables
ENV APP_HOME=/app
WORKDIR $APP_HOME
# Install necessary packages for Rails and system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
nodejs \
yarn \
&& rm -rf /var/lib/apt/lists/*
# Copy the application files
COPY . .
# Install Bundler
RUN gem install bundler
# Install dependencies
RUN bundle install
# Copy the entrypoint script and set execution permissions
COPY entrypoint.rb /entrypoint.rb
RUN chmod +x /entrypoint.rb
# Ensure reports directory exists before declaring a volume
RUN mkdir -p $APP_HOME/reports && chmod 777 $APP_HOME/reports
# Declare a volume for the reports directory
VOLUME ["/app/reports"]
# Set the entrypoint
ENTRYPOINT ["/entrypoint.rb"]