remove folder - untrustworthy
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
# Explore container for stocks-in-the-future — Rails 8.1 / Ruby 3.4.4, Postgres + Redis.
|
||||
# rubyforgood/stocks-in-the-future, pinned upstream at 63732df2. Adapted for live-mount:
|
||||
# repo bind-mounted at /workspace/repo; deps + DB set up by post-create.sh; Postgres +
|
||||
# Redis brought up by post-start.sh.
|
||||
#
|
||||
# Minitest; system specs use Selenium + headless Chrome (the repo's own config already
|
||||
# passes --no-sandbox + --disable-dev-shm-usage, so no chromium wrapper is needed here).
|
||||
FROM ruby:3.4.4
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential pkg-config libpq-dev \
|
||||
postgresql postgresql-client redis-server \
|
||||
chromium chromium-driver \
|
||||
libvips libyaml-dev locales \
|
||||
python3 \
|
||||
git sudo curl ca-certificates xz-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Ferrum/Selenium detect the browser by name; symlink google-chrome → chromium.
|
||||
RUN ln -sf /usr/bin/chromium /usr/local/bin/google-chrome \
|
||||
&& ln -sf /usr/bin/chromium /usr/local/bin/google-chrome-stable
|
||||
|
||||
# Locale + Postgres collation: rebuild the cluster under en_US.UTF-8 (apt default is
|
||||
# C.UTF-8 → byte-order; en_US.UTF-8 matches CI's postgres image and avoids locale-
|
||||
# ordering spec failures).
|
||||
RUN sed -i 's/^# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& PG_VERSION=$(ls /etc/postgresql) \
|
||||
&& pg_dropcluster "${PG_VERSION}" main \
|
||||
&& LANG=en_US.UTF-8 pg_createcluster --locale en_US.UTF-8 "${PG_VERSION}" main
|
||||
ENV LANG=en_US.UTF-8
|
||||
ENV LC_ALL=en_US.UTF-8
|
||||
|
||||
RUN PG_VERSION=$(ls /etc/postgresql) \
|
||||
&& printf 'local all all trust\nhost all all 127.0.0.1/32 trust\nhost all all ::1/128 trust\nhost all all 0.0.0.0/0 trust\n' > "/etc/postgresql/${PG_VERSION}/main/pg_hba.conf" \
|
||||
&& echo "listen_addresses='*'" >> "/etc/postgresql/${PG_VERSION}/main/postgresql.conf"
|
||||
|
||||
# config/database.yml.sample specifies no host/user (relies on libpq defaults), so pin
|
||||
# PGHOST/PGUSER → connect to the local postgres as the `postgres` superuser over TCP
|
||||
# (trust). REDIS_URL points at the baked-in redis (CI uses db index 1).
|
||||
ENV PGHOST=localhost
|
||||
ENV PGUSER=postgres
|
||||
ENV REDIS_URL=redis://localhost:6379/1
|
||||
|
||||
# Node 18 for toolkit tooling (create-snapshot hooks). App is importmap — no Node build.
|
||||
RUN set -eux; \
|
||||
arch="$(dpkg --print-architecture)"; \
|
||||
case "$arch" in amd64) nodearch=x64;; arm64) nodearch=arm64;; *) echo "unsupported arch: $arch" >&2; exit 1;; esac; \
|
||||
curl -fsSL "https://nodejs.org/dist/v18.20.5/node-v18.20.5-linux-${nodearch}.tar.xz" -o /tmp/node.tar.xz; \
|
||||
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \
|
||||
rm /tmp/node.tar.xz; node --version
|
||||
|
||||
# Match Gemfile.lock "BUNDLED WITH 2.6.7".
|
||||
RUN gem install bundler -v 2.6.7
|
||||
|
||||
USER root
|
||||
ENV IS_SANDBOX=1
|
||||
RUN mkdir -p /root/.claude && \
|
||||
echo '{"permissions":{"deny":["WebFetch","WebSearch"]}}' > /root/.claude/settings.json
|
||||
|
||||
WORKDIR /workspace/repo
|
||||
|
||||
# Start Postgres + Redis, wait for pg, seed the postgres role password (harmless w/ trust).
|
||||
RUN printf '#!/bin/bash\nset -e\nservice postgresql start\nservice redis-server start || redis-server --daemonize yes\nuntil pg_isready -h localhost -p 5432 -U postgres >/dev/null 2>&1; do sleep 0.5; done\nexec "$@"\n' > /usr/local/bin/start-services.sh \
|
||||
&& chmod +x /usr/local/bin/start-services.sh
|
||||
ENTRYPOINT ["/usr/local/bin/start-services.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
Reference in New Issue
Block a user