-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for different handling of module prepend in ruby <3
- Loading branch information
Showing
21 changed files
with
186 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Basic pagy-on-docker development environment | ||
# it will keep the installed gems and HOME in the pagy_bundle and pagy_user_home pagy-on-docker volumes | ||
# the pagy-jekill service will be updating a live preview for the docs | ||
|
||
# USAGE | ||
# cd pagy-on-docker | ||
# docker-compose up pagy # only pagy service (running ruby development and test environment) | ||
# docker-compose up pagy-jekyll # pagy and pagy-jekyll services (add the docs live site) | ||
# docker-compose up pagy-cyress # pagy and pagy-cyress services (run the e2e tests and exit) | ||
|
||
version: "3.8" | ||
|
||
services: | ||
|
||
# ruby dev and test pagy development | ||
# It also runs a minimal sinatra app at http://0.0.0.0:8080 | ||
pagy: | ||
image: pagy:4-backport | ||
build: | ||
context: . | ||
dockerfile: pagy-backport.dockerfile | ||
# set env variables with your user info | ||
args: | ||
user: $USER | ||
group: $GROUP | ||
uid: $UID | ||
gid: $GID | ||
password: "${PASSWORD:-rubydev}" | ||
term: ${TERM:-xterm-256color} | ||
container_name: pagy | ||
volumes: | ||
- ../.:/opt/project | ||
- bundle:/usr/local/bundle | ||
- user_home:/home/$USER | ||
environment: | ||
- COVERAGE_REPORT | ||
stdin_open: true | ||
tty: true | ||
|
||
# Serve the docs site live at http://0.0.0.0:4000 | ||
# Use it to check/edit the rendered content in the docs dir | ||
pagy-jekyll: | ||
depends_on: | ||
- pagy | ||
image: pagy-jekyll:latest | ||
build: | ||
context: . | ||
dockerfile: pagy-jekyll.dockerfile | ||
container_name: pagy-jekyll | ||
environment: | ||
- JEKYLL_GITHUB_TOKEN | ||
ports: | ||
- "4000:4000" | ||
- "35729:35729" | ||
volumes: | ||
- ../docs:/opt/docs | ||
- docs_site:/opt/site | ||
command: | | ||
jekyll serve \ | ||
--incremental \ | ||
--livereload \ | ||
--watch \ | ||
--force-polling \ | ||
--host 0.0.0.0 \ | ||
--baseurl '' \ | ||
--source /opt/docs \ | ||
--destination /opt/site | ||
stdin_open: true | ||
tty: true | ||
|
||
# you may want skip this service when you run the docker-compose.yml file | ||
# and run it only on demand to run the tests and exit, or to interact with cypress | ||
# using the additional open-cypress.yml (see the comments in the open-cypress.yml file) | ||
# IMPORTANT: pick the build.dockerfile entry according to your UID | ||
pagy-cypress: | ||
depends_on: | ||
- pagy | ||
image: pagy-cypress:latest | ||
build: | ||
context: . | ||
# switch between the following 2 lines if your user id is 1000 or not | ||
dockerfile: pagy-cypress-uid1000.dockerfile | ||
# dockerfile: pagy-cypress.dockerfile | ||
args: | ||
user: $USER | ||
group: $GROUP | ||
uid: $UID | ||
gid: $GID | ||
container_name: pagy-cypress | ||
environment: | ||
- CYPRESS_baseUrl=http://pagy:4567 | ||
working_dir: /test/e2e | ||
volumes: | ||
- ../test/e2e:/test/e2e | ||
|
||
volumes: | ||
bundle: | ||
name: pagy_backport_bundle | ||
user_home: | ||
name: pagy_backport_user_home | ||
docs_site: | ||
name: pagy_docs_site | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM ruby:2.7 | ||
|
||
ARG term | ||
ENV TERM="${term:-xterm-256color}" | ||
|
||
# install required packages | ||
RUN apt-get update && apt-get install -y locales \ | ||
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \ | ||
&& locale-gen \ | ||
&& apt-get install -y \ | ||
nodejs \ | ||
git \ | ||
nano | ||
|
||
ARG user | ||
ARG group | ||
ARG uid | ||
ARG gid | ||
ARG password=rubydev | ||
|
||
# setup users and .bashrc | ||
# - same pasword for user and root | ||
# - color prompt for user and root | ||
RUN groupadd --gid=$gid --force $group \ | ||
&& useradd --uid=$uid --gid=$gid --shell=/bin/bash --create-home $user \ | ||
&& echo $user:$password | chpasswd \ | ||
&& echo root:$password | chpasswd \ | ||
&& sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/' /home/$user/.bashrc \ | ||
&& sed -i 's/\\u@\\h\\\[\\033\[00m\\\]:\\\[\\033\[01;34m\\\]\\w\\\[\\033\[00m\\\]/\\u \\\[\\033\[01;34m\\\]\\w\\\[\\033\[00m\\\] /' /home/$user/.bashrc \ | ||
&& cp /home/$user/.bashrc /root/.bashrc | ||
|
||
ENV \ | ||
BUNDLE_PATH=/usr/local/bundle \ | ||
GEM_HOME=/usr/local/bundle \ | ||
BUNDLE_APP_CONFIG=/usr/local/bundle \ | ||
BUNDLE_BIN=/usr/local/bundle/bin \ | ||
BUNDLE_SILENCE_ROOT_WARNING=1 \ | ||
BUNDLE_CACHE_ALL=1 \ | ||
LS_OPTIONS='--color=auto' \ | ||
EDITOR=nano \ | ||
TERM=${term:-xterm-256color} \ | ||
SHELL=/bin/bash \ | ||
LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US.UTF-8 \ | ||
LC_ALL=en_US.UTF-8 | ||
|
||
RUN chown -R $uid:$gid $BUNDLE_PATH | ||
|
||
WORKDIR /opt/project | ||
|
||
VOLUME \ | ||
/home/$user \ | ||
$BUNDLE_PATH | ||
|
||
USER $user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters