From 001fff1e6ac8e52d3b64c39e8bfd0e9ad7dd0c7b Mon Sep 17 00:00:00 2001 From: Carlos Palhares Date: Sun, 13 Oct 2024 03:03:29 +0000 Subject: [PATCH] Initialize devcontainer --- .devcontainer/Dockerfile | 2 ++ .devcontainer/compose.yaml | 24 +++++++++++++++++++++++ .devcontainer/devcontainer.json | 34 +++++++++++++++++++++++++++++++++ audiences/Gemfile.lock | 3 +++ 4 files changed, 63 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/compose.yaml create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..d4992f41 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,2 @@ +ARG RUBY_VERSION=3.3.5 +FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml new file mode 100644 index 00000000..a865babd --- /dev/null +++ b/.devcontainer/compose.yaml @@ -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: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..16302bf0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" +} diff --git a/audiences/Gemfile.lock b/audiences/Gemfile.lock index e8c209f9..5baffabd 100644 --- a/audiences/Gemfile.lock +++ b/audiences/Gemfile.lock @@ -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) @@ -276,6 +278,7 @@ GEM zeitwerk (2.7.0) PLATFORMS + aarch64-linux arm64-darwin-22 arm64-darwin-23 arm64-darwin-24