forked from carabao-capital/devise-auth0
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a26fcd0
commit b02ef1e
Showing
12 changed files
with
145 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/ruby/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Ruby version: 3, 3.3, 3.2, 3.1, 3.0, 2, 2.7, 2.6 | ||
ARG VARIANT="2" | ||
FROM mcr.microsoft.com/devcontainers/ruby:${VARIANT} | ||
|
||
# Default value to allow debug server to serve content over GitHub Codespace's port forwarding service | ||
# The value is a comma-separated list of allowed domains | ||
ENV RAILS_DEVELOPMENT_HOSTS=".githubpreview.dev,.preview.app.github.dev,.app.github.dev" | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install --no-install-recommends \ | ||
postgresql-client \ | ||
postgresql-contrib \ | ||
libpq-dev | ||
|
||
# Install MongoDB Shell | ||
ARG MONGOSH_VERSION="2.1.4" | ||
RUN ARCH=$(dpkg --print-architecture) \ | ||
&& if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "arm64" ]; then \ | ||
wget -qO /tmp/mongosh.deb "https://downloads.mongodb.com/compass/mongodb-mongosh_${MONGOSH_VERSION}_${ARCH}.deb" \ | ||
&& apt-get install -y /tmp/mongosh.deb \ | ||
&& rm -rf /tmp/*; \ | ||
fi | ||
|
||
# Install supported Ruby versions | ||
# https://www.ruby-lang.org/en/downloads/releases/ | ||
RUN /bin/bash -c "source /usr/local/rvm/scripts/rvm \ | ||
&& rvm install 2.7.8 \ | ||
&& rvm install 3.0.6 \ | ||
&& rvm install 3.1.4 \ | ||
&& rvm install 3.2.3 \ | ||
&& rvm install 3.3.0" | ||
|
||
# Set the default bundle path | ||
ENV BUNDLE_PATH=/usr/local/bundle | ||
|
||
# Install gem dependencies | ||
RUN mkdir -p /tmp/gem/lib/devise/auth0 | ||
COPY gemfiles /tmp/gem/gemfiles | ||
COPY lib/devise/auth0/version.rb /tmp/gem/lib/devise/auth0 | ||
COPY Appraisals devise_auth0.gemspec Gemfile Gemfile.lock /tmp/gem/ | ||
RUN mkdir -p ${BUNDLE_PATH} \ | ||
&& gem install bundler:2.4.21 \ | ||
&& cd /tmp/gem \ | ||
&& bundle install --jobs=3 --retry=3 \ | ||
&& bundle exec appraisal install \ | ||
&& rm -rf /tmp/gem | ||
VOLUME ["/usr/local/bundle"] | ||
|
||
RUN chown -R vscode:vscode /usr/local/rvm ${BUNDLE_PATH} |
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,9 @@ | ||
sudo chown -R vscode:vscode ${BUNDLE_PATH} && \ | ||
bundle install --jobs=3 --retry=3 && \ | ||
bundle exec appraisal install | ||
|
||
# Rebuild PostgreSQL | ||
dropdb --if-exists devise_auth0_test | ||
dropdb --if-exists devise_auth0_development | ||
createdb -E UTF8 -T template0 devise_auth0_test --lc-collate en_US.UTF-8 | ||
createdb -E UTF8 -T template0 devise_auth0_development --lc-collate en_US.UTF-8 |
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,53 @@ | ||
version: '3' | ||
|
||
services: | ||
app: | ||
build: | ||
context: .. | ||
dockerfile: .devcontainer/Dockerfile | ||
|
||
volumes: | ||
- ../..:/workspaces:cached | ||
- bundle-data:/usr/local/bundle | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
networks: | ||
- default | ||
|
||
depends_on: | ||
- mongodb | ||
- postgres | ||
|
||
mongodb: | ||
image: mongodb/mongodb-community-server | ||
restart: unless-stopped | ||
networks: | ||
- default | ||
volumes: | ||
- mongodb-data:/data/db | ||
environment: | ||
MONGODB_INITDB_ROOT_USERNAME: mongodb | ||
MONGODB_INITDB_ROOT_PASSWORD: mongodb | ||
|
||
postgres: | ||
image: postgres:latest | ||
restart: unless-stopped | ||
networks: | ||
- default | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
|
||
networks: | ||
default: | ||
|
||
volumes: | ||
bundle-data: | ||
mongodb-data: | ||
postgres-data: |
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