32 lines
1.4 KiB
Docker
32 lines
1.4 KiB
Docker
# Example .safeclaude/Dockerfile for a Ruby + Postgres app.
|
|
#
|
|
# Everything here runs once when the container is built (and is cached), so it
|
|
# won't slow down launches. You're root during the build, so apt just works.
|
|
FROM safeclaude-base:latest
|
|
|
|
# System packages: what's needed to build Ruby, talk to Postgres, proxy the
|
|
# database (socat), and run browser tests (headless Chrome).
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
libssl-dev libreadline-dev zlib1g-dev libffi-dev libyaml-dev \
|
|
libpq-dev \
|
|
socat \
|
|
chromium chromium-driver \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Capybara/Selenium look for Chrome at these paths.
|
|
ENV CHROME_BIN=/usr/bin/chromium
|
|
ENV CHROMEDRIVER=/usr/bin/chromedriver
|
|
|
|
# rbenv and nvm get installed by the hooks at launch instead of here, because
|
|
# they live in the home folder — and that folder is swapped in fresh each run, so
|
|
# anything we installed there now would just be thrown away. Here we only set the
|
|
# paths and shell setup; the two lines below do nothing until a hook installs the
|
|
# matching tool.
|
|
ENV RBENV_ROOT=/home/coder/.rbenv
|
|
ENV NVM_DIR=/home/coder/.nvm
|
|
ENV PATH="$RBENV_ROOT/bin:$RBENV_ROOT/shims:$PATH"
|
|
|
|
RUN echo '[ -d "$RBENV_ROOT/bin" ] && eval "$(rbenv init - bash)"' >> /etc/bash.bashrc && \
|
|
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> /etc/bash.bashrc
|