diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml index add20365..2543a97a 100644 --- a/.devcontainer/compose.yaml +++ b/.devcontainer/compose.yaml @@ -3,9 +3,11 @@ services: build: slackbot volumes: - ..:/code + - /code/node_modules + - /code/functions/node_modules stdin_open: true tty: true - command: sh -c "echo hoge" + command: sleep infinity environment: - TEAM_ID=${TEAM_ID} - SIGNING_SECRET=${SIGNING_SECRET} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ee442039..4dede5ba 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,8 +17,6 @@ "ghcr.io/devcontainers/features/common-utils:2": { "installZsh": "true", "username": "slackbot", - "userUid": "1000", - "userGid": "1000", "upgradePackages": "true" } }, @@ -27,24 +25,10 @@ "tunnel" ], "postAttachCommand": "docker logs slackbot_devcontainer-tunnel-1 && docker attach slackbot_devcontainer-tunnel-1", - "onCreateCommand": "cp -RTf ~/.cache/slackbot/node_modules /code/node_modules && cp -RTf ~/.cache/slackbot-functions/node_modules /code/functions/node_modules", - "postStartCommand": "echo 'postStart: Please run `docker-compose up` to start the services.'", - "postCreateCommand": "echo 'postCreate: Please run `docker-compose up` to start the services.'", - "initializeCommand": "echo 'initialize: Please run `docker-compose up` to start the services.'", - "updateContentCommand": "echo 'updateContent: Please run `docker-compose up` to start the services.'" - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "yarn install", - // Configure tool-specific properties. // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" } diff --git a/.devcontainer/slackbot/Dockerfile b/.devcontainer/slackbot/Dockerfile index 7ce21844..fb4c0cd6 100644 --- a/.devcontainer/slackbot/Dockerfile +++ b/.devcontainer/slackbot/Dockerfile @@ -5,18 +5,11 @@ FROM node:20-bookworm RUN apt-get update -y && \ apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -y && \ apt-get install git bash -y && \ - mkdir -p /code/functions && \ mkdir -p ~/.cache/slackbot/node_modules && \ mkdir -p ~/.cache/slackbot-functions/node_modules && \ + git clone https://github.com/tsg-ut/slackbot.git --branch master --single-branch --recursive --depth 1 /code && \ cd /code && \ - ln -s ~/.cache/slackbot/node_modules node_modules && \ - ln -s ~/.cache/slackbot-functions/node_modules functions/node_modules && \ - wget https://github.com/tsg-ut/slackbot/raw/refs/heads/master/package.json && \ - wget https://github.com/tsg-ut/slackbot/raw/refs/heads/master/package-lock.json && \ - wget https://github.com/tsg-ut/slackbot/raw/refs/heads/master/functions/package.json -O functions/package.json && \ - wget https://github.com/tsg-ut/slackbot/raw/refs/heads/master/functions/package-lock.json -O functions/package-lock.json && \ - npm install --ignore-scripts && \ - npm install --ignore-scripts --prefix functions && \ + npm install && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*