-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (49 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
65 lines (49 loc) · 1.45 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
# Dockerfile
# Stage 1: Build
FROM ruby:3.2.2 AS builder
# Set working directory
WORKDIR /app
# Install Rust and dependencies required for blake3-rb
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
gcc \
g++ \
libclang-dev \
libssl-dev \
libffi-dev \
make \
&& rm -rf /var/lib/apt/lists/* \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Copy Gemfile and Gemfile.lock
COPY Gemfile Gemfile.lock ./
# Install dependencies
RUN gem install bundler && bundle install
# Copy the rest of the application code
COPY . .
# Stage 2: Production
FROM ruby:3.2.2-slim
# Install necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
libmemcached-dev \
libssl-dev \
libffi-dev \
make \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy application code and installed gems from build stage
COPY --from=builder /app /app
COPY --from=builder /usr/local/bundle /usr/local/bundle
# Ensure bundler is available in the production stage
RUN gem install bundler
# Copy the config directory to grab puma configuration
COPY config /app/config
# Copy the entrypoint script
COPY app/scripts/entrypoint.sh /app/entrypoint.sh
# Make sure the entrypoint script has execute permission
RUN chmod +x /app/entrypoint.sh
# Expose the port the app runs on
EXPOSE 9292
# Set the entrypoint script
ENTRYPOINT ["/app/entrypoint.sh"]