Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
ARG RUBY_VERSION=3.4.7
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION

# Ensure binding is always 0.0.0.0
# Binds the server to all IP addresses of the container, so it can be accessed from outside the container.
ENV BINDING="0.0.0.0"
31 changes: 31 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "fizzy"

services:
rails:
container_name: ${COMPOSE_PROJECT_NAME}-rails
build:
context: ..
dockerfile: .devcontainer/Dockerfile

volumes:
- ../../${COMPOSE_PROJECT_NAME}:/workspaces/${COMPOSE_PROJECT_NAME}:cached
- ~/.config/gh:/home/dev/.config/gh:cached

environment:
GH_CONFIG_DIR: /home/dev/.config/gh

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
depends_on:
- selenium

selenium:
container_name: ${COMPOSE_PROJECT_NAME}-selenium
image: selenium/standalone-chromium
restart: unless-stopped
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://containers.dev/implementors/json_reference/.
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "fizzy",
"dockerComposeFile": "compose.yaml",
"service": "rails",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/rails/devcontainer/features/activestorage": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {"moby":false},
"ghcr.io/rails/devcontainer/features/sqlite3": {},
"ghcr.io/rio/features/gum:1": {},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {}
},

"containerEnv": {
"RAILS_ENV": "development",
"GH_TOKEN": "${localEnv:GH_TOKEN}",
"CAPYBARA_SERVER_PORT": "45678",
"SELENIUM_HOST": "selenium",
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 3006, 5001],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
// "remoteUser": "root",


// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bin/setup --skip-server"
}
1 change: 1 addition & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ gum style --foreground 153 " ˚ ∘ ∘ ˚ "
gum style --foreground 111 --bold " ∘˚˳°∘° 𝒻𝒾𝓏𝓏𝓎 °∘°˳˚∘ "
echo

step "Trusting mise config" mise trust
step "Installing Ruby" mise install --yes
eval "$(mise hook-env -s bash)"

Expand Down