From c55ce906509f439579ed83555208c5ae934ea886 Mon Sep 17 00:00:00 2001 From: shizukanaoki Date: Tue, 7 Jan 2025 15:58:17 +0900 Subject: [PATCH 1/4] make available in dev container --- .devcontainer/Dockerfile | 24 ++++++++++++++++-------- .devcontainer/devcontainer.json | 12 +++++++----- .devcontainer/postAttachCommand.sh | 6 ++++-- .devcontainer/postCreateCommand.sh | 3 +-- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0da79a0..481071d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,20 +1,28 @@ -FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 +FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 -# SHELL ["/bin/bash", "-c"] - -RUN apt-get update && apt-get -y install curl git libgtk-3.0 libnss3 libdrm-dev libgbm-dev libasound2 sqlite3 mysql-client +SHELL ["/bin/bash", "-c"] USER vscode +RUN sudo apt-get update && sudo apt-get install -y curl \ + libgtk-3-dev \ + libnotify-dev \ + libnss3 \ + libxss1 \ + libasound2t64 \ + mysql-client \ + unzip + +# Progate CLI +RUN curl -sSfL https://assets.path.progate.com/cli-installer/out/setup.sh | bash -s -- -y + +# nodenv RUN git clone https://github.com/nodenv/nodenv.git ~/.nodenv RUN echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc RUN echo 'eval "$(nodenv init -)"' >> ~/.bashrc - RUN mkdir -p "$HOME/.nodenv"/plugins RUN git clone https://github.com/nodenv/node-build.git "$HOME/.nodenv"/plugins/node-build - # Arielのnodeバージョンと揃える +# Ariel の nodeバージョンと揃える RUN $HOME/.nodenv/bin/nodenv install 18.17.1 RUN $HOME/.nodenv/bin/nodenv global 18.17.1 - -RUN curl -sSfL https://assets.path.progate.com/cli-installer/out/setup.sh | bash -s -- -y diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e6bb749..58f2fe6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,15 +1,17 @@ { - "name": "express-generated-devcontainer", + "name": "progate-path-dev-container", "build": { "dockerfile": "Dockerfile" }, "runArgs": ["--init", "--privileged"], "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/environment,type=bind,consistency=cached", "workspaceFolder": "/home/vscode", "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2.9.0": {}, + "ghcr.io/devcontainers/features/aws-cli:1": {}, + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/sshd:1": { - "version": "latest" - } + "ghcr.io/devcontainers/features/sshd:1": {}, + "ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {}, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} }, "forwardPorts": [3000, 8000], // Configure tool-specific properties. diff --git a/.devcontainer/postAttachCommand.sh b/.devcontainer/postAttachCommand.sh index 038c160..c6fa7e1 100644 --- a/.devcontainer/postAttachCommand.sh +++ b/.devcontainer/postAttachCommand.sh @@ -1,4 +1,6 @@ #!/bin/bash -gh codespace ports visibility 3000:public -c $CODESPACE_NAME -gh codespace ports visibility 8000:public -c $CODESPACE_NAME +if [ -n "$CODESPACES" ]; then + gh codespace ports visibility 3000:public -c $CODESPACE_NAME + gh codespace ports visibility 8000:public -c $CODESPACE_NAME +fi diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index c7de6b5..4aa0a83 100644 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,4 +1,3 @@ #!/bin/bash - sudo git config --system core.editor 'code --wait' -cd ./environment && docker-compose up -d +docker compose -f $HOME/environment/docker-compose.yml up -d From 924eb9f86ba2f39f088d46e0e60a4a4bec179bb7 Mon Sep 17 00:00:00 2001 From: shizukanaoki Date: Wed, 8 Jan 2025 15:29:47 +0900 Subject: [PATCH 2/4] tmp --- .devcontainer/Dockerfile | 11 ++--------- .devcontainer/postAttachCommand.sh | 2 ++ .devcontainer/postCreateCommand.sh | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 481071d..c4d2ef5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,17 +1,10 @@ -FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 +FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 SHELL ["/bin/bash", "-c"] USER vscode -RUN sudo apt-get update && sudo apt-get install -y curl \ - libgtk-3-dev \ - libnotify-dev \ - libnss3 \ - libxss1 \ - libasound2t64 \ - mysql-client \ - unzip +RUN sudo apt update && sudo apt install -y libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 chromium-browser # Progate CLI RUN curl -sSfL https://assets.path.progate.com/cli-installer/out/setup.sh | bash -s -- -y diff --git a/.devcontainer/postAttachCommand.sh b/.devcontainer/postAttachCommand.sh index c6fa7e1..137d920 100644 --- a/.devcontainer/postAttachCommand.sh +++ b/.devcontainer/postAttachCommand.sh @@ -4,3 +4,5 @@ if [ -n "$CODESPACES" ]; then gh codespace ports visibility 3000:public -c $CODESPACE_NAME gh codespace ports visibility 8000:public -c $CODESPACE_NAME fi + +docker compose -f $HOME/environment/docker-compose.yml up -d diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 4aa0a83..a1aafbe 100644 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,3 +1,3 @@ #!/bin/bash + sudo git config --system core.editor 'code --wait' -docker compose -f $HOME/environment/docker-compose.yml up -d From 7ea409aac0c3fcf5fc0437c069dd454e117ca995 Mon Sep 17 00:00:00 2001 From: shizukanaoki Date: Fri, 24 Jan 2025 14:59:52 +0900 Subject: [PATCH 3/4] fix base image --- .devcontainer/Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ce3e095..b90ae0f 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,10 +1,17 @@ -FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04 +FROM mcr.microsoft.com/devcontainers/base:debian SHELL ["/bin/bash", "-c"] USER vscode -RUN sudo apt update && sudo apt install -y libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 chromium-browser +RUN sudo apt update && sudo apt install -y \ + libgtk-3-dev \ + libnotify-dev \ + libgconf-2-4 \ + libnss3 \ + libxss1 \ + libasound2 \ + chromium # Progate CLI RUN curl -sSfL https://assets.path.progate.com/cli-installer/out/setup.sh | bash -s -- -y @@ -20,3 +27,5 @@ RUN git clone https://github.com/nodenv/node-build.git "$HOME/.nodenv"/plugins/n RUN $HOME/.nodenv/bin/nodenv install 22.12.0 RUN $HOME/.nodenv/bin/nodenv global 22.12.0 +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium From 889f309ae893c31ee5e5dbee176ba22ed53add5f Mon Sep 17 00:00:00 2001 From: shizukanaoki Date: Fri, 24 Jan 2025 15:01:56 +0900 Subject: [PATCH 4/4] Update Dockerfile --- .devcontainer/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b90ae0f..de8ea1b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -27,5 +27,6 @@ RUN git clone https://github.com/nodenv/node-build.git "$HOME/.nodenv"/plugins/n RUN $HOME/.nodenv/bin/nodenv install 22.12.0 RUN $HOME/.nodenv/bin/nodenv global 22.12.0 +# Puppeteer の設定 ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium