Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

chore: initialize devcontainer setup for better DX#4285

Open
FelixRizzolli wants to merge 1 commit intosct:developfrom
FelixRizzolli:chore/devcontainer
Open

chore: initialize devcontainer setup for better DX#4285
FelixRizzolli wants to merge 1 commit intosct:developfrom
FelixRizzolli:chore/devcontainer

Conversation

@FelixRizzolli
Copy link
Copy Markdown

Description

This pull request sets up a new development container configuration for the project, making it easier to work in a standardized and reproducible environment. It introduces Docker and devcontainer files, configures the container for TypeScript/Node development, sets up SSH key handling, and includes recommended VSCode extensions and settings for a smooth developer experience.

Devcontainer setup:

  • Added .devcontainer/Dockerfile to define the devcontainer image based on TypeScript/Node 18, install common dependencies, configure Bash and Git, and install GitHub CLI. The container exposes port 5055.
  • Created .devcontainer/compose.yml for Docker Compose configuration, mapping the workspace, SSH keys, and setup script into the container, and forwarding port 5055.
  • Added .devcontainer/devcontainer.json to specify the devcontainer name, service, VSCode extensions, editor settings, and post-create setup script. It also configures port forwarding and workspace folder.

Environment and setup scripts:

  • Added .devcontainer/.env to define PORT and HOST environment variables for the container.
  • Introduced .devcontainer/setup.sh to automate copying and securing SSH keys within the container for git access.

To-Dos

  • Successful build yarn build
  • Translation keys yarn i18n:extract

Copilot AI review requested due to automatic review settings November 9, 2025 10:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds DevContainer configuration to enable a consistent development environment using VS Code's DevContainers feature. The setup includes Docker configuration, automated SSH key management, and VS Code extensions/settings for the Overseer project.

  • Adds Docker Compose setup with devcontainer service
  • Implements automated SSH key copying and permission configuration
  • Configures VS Code with project-specific extensions and settings

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.devcontainer/Dockerfile Creates a Node 18-based development container with Git, GitHub CLI, and common utilities
.devcontainer/compose.yml Defines Docker Compose service with volume mounts for workspace and SSH keys
.devcontainer/devcontainer.json Configures VS Code extensions, settings, and port forwarding for the development environment
.devcontainer/setup.sh Bash script that copies SSH keys from mounted volume and sets proper permissions
.devcontainer/.env Defines environment variables for port and host configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .devcontainer/setup.sh
# Copy SSH keys
echo "🔑 Configuring SSH keys..."
mkdir -p /root/.ssh
cp -p /root/local-ssh/* /root/.ssh/
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cp command will fail if /root/local-ssh/ is empty or doesn't exist, causing the setup script to abort due to set -e. Add a check to verify the directory exists and contains files, or use a glob pattern that won't fail: cp -p /root/local-ssh/* /root/.ssh/ 2>/dev/null || true or add an existence check before copying.

Suggested change
cp -p /root/local-ssh/* /root/.ssh/
cp -p /root/local-ssh/* /root/.ssh/ 2>/dev/null || true

Copilot uses AI. Check for mistakes.
Comment thread .devcontainer/Dockerfile
@@ -0,0 +1,31 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:18
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base image tag :18 is not pinned to a specific version, which means builds may produce different results over time as the underlying image updates. Consider using a specific version tag like :18-bullseye or a digest to ensure reproducible builds.

Suggested change
FROM mcr.microsoft.com/devcontainers/typescript-node:18
FROM mcr.microsoft.com/devcontainers/typescript-node:18-bullseye

Copilot uses AI. Check for mistakes.
Comment thread .devcontainer/Dockerfile
Comment on lines +14 to +19
(type -p curl >/dev/null || (apt-get install curl -y)) && \
(type -p ca-certificates >/dev/null || (apt-get install ca-certificates -y)) && \
(type -p gnupg >/dev/null || (apt-get install gnupg -y)) && \
(type -p wget >/dev/null || (apt-get install wget -y)) && \
(type -p unzip >/dev/null || (apt-get install unzip -y)) && \
(type -p lsb-release >/dev/null || (apt-get install lsb-release -y)) && \
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type -p checks for package binaries won't work correctly for packages like ca-certificates, gnupg, and lsb-release which don't provide executables with those exact names. These checks will always fail and attempt installation. Use dpkg -l | grep -q <package> instead, or simply install all packages unconditionally since apt-get install handles already-installed packages gracefully.

Suggested change
(type -p curl >/dev/null || (apt-get install curl -y)) && \
(type -p ca-certificates >/dev/null || (apt-get install ca-certificates -y)) && \
(type -p gnupg >/dev/null || (apt-get install gnupg -y)) && \
(type -p wget >/dev/null || (apt-get install wget -y)) && \
(type -p unzip >/dev/null || (apt-get install unzip -y)) && \
(type -p lsb-release >/dev/null || (apt-get install lsb-release -y)) && \
apt-get install -y curl ca-certificates gnupg wget unzip lsb-release && \

Copilot uses AI. Check for mistakes.
Comment thread .devcontainer/compose.yml
Comment on lines +8 to +14
env_file:
- path: ./.env
required: true
volumes:
- ../:/workspace
# Mount the SSH keys from the host to the container for git access
- ~/.ssh:/root/local-ssh
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mounting the entire ~/.ssh directory grants the container access to all SSH keys from the host, including keys for other services. Consider mounting only specific keys needed for the project (e.g., ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub) or using SSH agent forwarding instead with - $SSH_AUTH_SOCK:/ssh-agent and SSH_AUTH_SOCK=/ssh-agent environment variable.

Suggested change
env_file:
- path: ./.env
required: true
volumes:
- ../:/workspace
# Mount the SSH keys from the host to the container for git access
- ~/.ssh:/root/local-ssh
SSH_AUTH_SOCK: /ssh-agent
env_file:
- path: ./.env
required: true
volumes:
- ../:/workspace
# Forward the SSH agent socket for git access
- $SSH_AUTH_SOCK:/ssh-agent

Copilot uses AI. Check for mistakes.
Comment thread .devcontainer/setup.sh

echo "🔒 Setting SSH key permissions..."
chmod 700 /root/.ssh
find /root/.ssh -type f -exec sh -c 'case "$1" in *.pub) chmod 644 "$1";; *) chmod 600 "$1";; esac' _ {} \;
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script sets permissions for all files in /root/.ssh, but SSH requires stricter permissions. The known_hosts file should be 644, authorized_keys should be 600, and private keys should be 600. However, files like config should be 600, not 644. The current logic incorrectly assumes only .pub files should be readable. Consider being more explicit: set 600 for everything by default, then specifically set 644 only for .pub files.

Suggested change
find /root/.ssh -type f -exec sh -c 'case "$1" in *.pub) chmod 644 "$1";; *) chmod 600 "$1";; esac' _ {} \;
# Set 600 for all files by default
find /root/.ssh -type f -exec chmod 600 {} \;
# Set 644 for public keys and known_hosts
find /root/.ssh -type f -name "*.pub" -exec chmod 644 {} \;
if [ -f /root/.ssh/known_hosts ]; then chmod 644 /root/.ssh/known_hosts; fi

Copilot uses AI. Check for mistakes.
@stale
Copy link
Copy Markdown

stale Bot commented Feb 4, 2026

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Feb 4, 2026
@fallenbagel
Copy link
Copy Markdown
Contributor

@FelixRizzolli hi 👋🏼

I like the idea behind improving DX. While I personally don’t use devcontainers, I’m sure many other developers do.

Would you mind transferring this PR over to https://github.com/seerr-team/seerr? This repository is no longer actively maintained

@stale stale Bot removed the stale label Feb 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants