FROM ruby:alpine3.23
# Install system dependencies needed for building native gems and Ruby headers
RUN apk add --no-cache build-base ruby-dev zlib-dev curl
# Ensure gem binaries are in PATH by placing rack's bin in /usr/local/bin
RUN gem install rack --no-document --bindir /usr/local/bin
# Create app directory and set as working directory
WORKDIR /app
# Copy source code
COPY . .
# Expose Rack default port
EXPOSE 9292
# Run the Rack-based application
CMD ["sh", "-lc", "rackup -o 0.0.0.0 -p 9292"]