Просмотр исходного кода

remove pdf-converter Dockerfile

Futa Arai 1 год назад
Родитель
Сommit
e669912dc4

+ 1 - 1
.devcontainer/app/devcontainer.json

@@ -16,7 +16,7 @@
   // "forwardPorts": [],
 
   // Use 'postCreateCommand' to run commands after the container is created.
-  "postCreateCommand": "/bin/bash ./.devcontainer/postCreateCommand.sh",
+  "postCreateCommand": "/bin/bash ./.devcontainer/app/postCreateCommand.sh",
 
   // Configure tool-specific properties.
   "customizations": {

+ 0 - 0
.devcontainer/postCreateCommand.sh → .devcontainer/app/postCreateCommand.sh


+ 1 - 7
.devcontainer/compose.yml

@@ -43,13 +43,7 @@ services:
       - ../../growi-docker-compose/elasticsearch/v8/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
 
   pdf-converter:
-    user: node
-    build:
-      context: .
-      dockerfile: ./pdf-converter/Dockerfile
-    restart: unless-stopped
-    ports:
-      - 3010
+    image: mcr.microsoft.com/devcontainers/base:ubuntu
     volumes:
       - ..:/workspace/growi:delegated
       - node_modules:/workspace/growi/node_modules

+ 0 - 38
.devcontainer/pdf-converter/Dockerfile

@@ -1,38 +0,0 @@
-#-------------------------------------------------------------------------------------------------------------
-# Copyright (c) Microsoft Corporation. All rights reserved.
-# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
-#-------------------------------------------------------------------------------------------------------------
-
-FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:1-20
-
-# The node image includes a non-root user with sudo access. Use the
-# "remoteUser" property in devcontainer.json to use it. On Linux, update
-# these values to ensure the container user's UID/GID matches your local values.
-# See https://aka.ms/vscode-remote/containers/non-root-user for details.
-ARG USERNAME=node
-ARG USER_UID=1000
-ARG USER_GID=$USER_UID
-
-ENV LANG=ja_JP.UTF-8
-
-RUN mkdir -p /workspace/growi/node_modules
-RUN mkdir -p /workspace/growi/apps/pdf-converter/node_modules
-
-# [Optional] Update UID/GID if needed
-RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
-        groupmod --gid $USER_GID $USERNAME \
-        && usermod --uid $USER_UID --gid $USER_GID $USERNAME; \
-    fi
-RUN chown -R $USER_UID:$USER_GID /home/$USERNAME /workspace;
-
-# Uncomment to default to non-root user
-# USER $USER_UID
-
-RUN apt-get update \
-    && apt-get -y install --no-install-recommends \
-    chromium locales fonts-ipafont fonts-ipaexfont fonts-ipafont-gothic fonts-ipafont-mincho git-lfs && \
-    echo "ja_JP UTF-8" > /etc/locale.gen && locale-gen
-
-RUN yarn global add turbo
-
-RUN git config --global --add safe.directory /workspace/growi

+ 19 - 5
.devcontainer/pdf-converter/devcontainer.json

@@ -1,8 +1,22 @@
 {
   "name": "GROWI-PDF-Converter",
-  "dockerComposeFile": "../docker-compose.yml",
+  "dockerComposeFile": "../compose.yml",
   "service": "pdf-converter",
   "workspaceFolder": "/workspace/growi",
+
+  "features": {
+    "ghcr.io/devcontainers/features/node:1": {
+      "version": "20.18.0"
+    }
+  },
+
+  // 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": "/bin/bash ./.devcontainer/app/postCreateCommand.sh",
+
+  // Configure tool-specific properties.
   "customizations": {
     "vscode": {
       "extensions": [
@@ -14,8 +28,8 @@
         "terminal.integrated.defaultProfile.linux": "bash"
       }
     }
-  },
-  "forwardPorts": [3010],
-  "postCreateCommand": "git-lfs pull",
-  "remoteUser": "node"
+  }
+
+  // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
+  // "remoteUser": "root"
 }

+ 20 - 0
.devcontainer/pdf-converter/postCreateCommand.sh

@@ -0,0 +1,20 @@
+sudo chown -R vscode:vscode /workspace;
+
+# Instal additional packages
+sudo apt update
+sudo apt-get install -y --no-install-recommends \
+  chromium locales fonts-ipafont fonts-ipaexfont fonts-ipafont-gothic fonts-ipafont-mincho
+sudo apt-get clean -y
+
+echo "ja_JP UTF-8" > /etc/locale.gen && locale-gen
+export LANG=ja_JP.UTF-8
+
+# Setup pnpm
+SHELL=bash pnpm setup
+eval "$(cat /home/vscode/.bashrc)"
+
+# Install turbo
+pnpm install turbo --global
+
+# Install dependencies
+turbo run bootstrap