Skip to content

Commit

Permalink
Initialize devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed Oct 13, 2024
1 parent 315c30a commit 001fff1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARG RUBY_VERSION=3.3.5
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
24 changes: 24 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Audiences Dev"

services:
dev:
build:
context: .
dockerfile: .devcontainer/Dockerfile

volumes:
- .:/workspaces:cached

# 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:
- dummy-web

volumes:
redis-data:
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "audiences",
"dockerComposeFile": ["../docker-compose.yml", "compose.yaml"],
"service": "dev",
"workspaceFolder": "/workspaces",

// 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/bundler-cache:1": {},
"ghcr.io/rails/devcontainer/features/mysql-client": {},
"ghcr.io/rails/devcontainer/features/postgres-client": {}
},

"containerEnv": {
"RAILS_ENV": "development",
"VITE_RUBY_HOST": "dummy-vite",
"DATABASE_HOST": "mysql"
},

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

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

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root",

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "bin/setup"
}
3 changes: 3 additions & 0 deletions audiences/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.6-x86_64-linux)
Expand Down Expand Up @@ -276,6 +278,7 @@ GEM
zeitwerk (2.7.0)

PLATFORMS
aarch64-linux
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
Expand Down

0 comments on commit 001fff1

Please sign in to comment.