resume-resume-github-com
SUCCESS
2m 33s
History Source
SummaryIterations1Transcript3Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile829 bytes written
text34 lines · 829 chars
FROM ruby:alpine3.23

# Install system dependencies and build tools
RUN apk update \
  && apk add --no-cache build-base libxml2-dev libxslt-dev libffi-dev zlib-dev \
  && rm -rf /var/cache/apk/*

# Install essential Ruby gems
RUN gem install bundler && gem install rack

# Create a non-root user for running the application
RUN addgroup -S app && adduser -S -G app app

# Set work directory for the application
WORKDIR /app

# Copy source code
COPY . .

# Ensure proper permissions
RUN chown -R app:app /app

# Install Ruby dependencies (if a Gemfile is present). This must run as root.
RUN if [ -f Gemfile ]; then bundle install; fi

# Switch to non-root user for running the app
USER app

# Expose the application port
EXPOSE 9292

# Command to run the Rack-based app
CMD ["rackup", "config.ru", "-o", "0.0.0.0", "-p", "9292"]
WRITEWriteFile· step #2
0s
.dockerignore111 bytes written
dockerignore12 lines · 111 chars
# Ignore node_modules, vendor, and logs
node_modules/
vendor/
.env
*.log
.DS_Store
.git
.github
tmp/
.bundle/

VERIFYVerifyBuild· step #3
1m 22s
VerifyBuildaccepted
Smoke [PASS]: cd /app; rackup config.ru -o 0.0.0.0 -p 9292 & sleep 2; curl -sS http://localhost:9292/ | grep -qi -E 'hello|world' && echo PASS || echo FAIL
Smoke [PASS]: cd /app; if [ -x ./smoke.sh ]; then sh ./smoke.sh; elif [ -f ./health.sh ]; then sh ./health.sh; else echo 'NO_SMOKE'; fi