Skip to content

Commit

Permalink
Merge pull request #9280 from weseek/feat/135772-155547-pdf-converter…
Browse files Browse the repository at this point in the history
…-tsed-devcontainer

Feat/135772 155547 pdf converter tsed devcontainer
  • Loading branch information
yuki-takei authored Nov 11, 2024
2 parents b8116b8 + d86313d commit 8420213
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "GROWI-Dev",
"dockerComposeFile": "compose.yml",
"service": "node",
"dockerComposeFile": "../compose.yml",
"service": "app",
"workspaceFolder": "/workspace/growi",

"features": {
Expand All @@ -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": {
Expand All @@ -37,6 +37,9 @@
"vitest.explorer",
"ms-playwright.playwright"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},

Expand Down
File renamed without changes.
14 changes: 13 additions & 1 deletion .devcontainer/compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
services:
node:
app:
image: mcr.microsoft.com/devcontainers/base:ubuntu
volumes:
- ..:/workspace/growi:delegated
- pnpm-store:/workspace/growi/.pnpm-store
- node_modules:/workspace/growi/node_modules
- buildcache_app:/workspace/growi/apps/app/.next
- ../../growi-docker-compose:/workspace/growi-docker-compose:delegated
- page_bulk_export_tmp:/tmp/page-bulk-export
tty: true

mongo:
Expand Down Expand Up @@ -40,7 +41,18 @@ services:
- /usr/share/elasticsearch/data
- ../../growi-docker-compose/elasticsearch/v8/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml

pdf-converter:
# enabling devcontainer 'features' was not working for secondary devcontainer (https://github.com/devcontainers/features/issues/1175)
image: mcr.microsoft.com/vscode/devcontainers/javascript-node:0-20
volumes:
- ..:/workspace/growi:delegated
- pnpm-store:/workspace/growi/.pnpm-store
- node_modules:/workspace/growi/node_modules
- page_bulk_export_tmp:/tmp/page-bulk-export
tty: true

volumes:
pnpm-store:
node_modules:
buildcache_app:
page_bulk_export_tmp:
29 changes: 29 additions & 0 deletions .devcontainer/pdf-converter/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "GROWI-PDF-Converter",
"dockerComposeFile": "../compose.yml",
"service": "pdf-converter",
"workspaceFolder": "/workspace/growi",

// 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/pdf-converter/postCreateCommand.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"eamodio.gitlens"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
17 changes: 17 additions & 0 deletions .devcontainer/pdf-converter/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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

# Setup pnpm
SHELL=bash pnpm setup
eval "$(cat /home/node/.bashrc)"
# Update pnpm
pnpm i -g pnpm

# Install turbo
pnpm install turbo --global

# Install dependencies
turbo run bootstrap
2 changes: 1 addition & 1 deletion apps/pdf-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"private": true,
"scripts": {
"dev:pdf-converter": "nodemon --watch \"src/**/*.ts\" --ignore \"node_modules/**/*\" --exec ts-node -r \"dotenv-flow/config\" src/index.ts",
"dev": "nodemon --watch \"src/**/*.ts\" --ignore \"node_modules/**/*\" --exec ts-node -r \"dotenv-flow/config\" src/index.ts",
"lint": "pnpm eslint **/*.{js,ts}",
"gen:client-code": "tsed run generate-swagger --output ./specs && orval",
"build": "pnpm gen:client-code && tsc -p tsconfig.build.json"
Expand Down

0 comments on commit 8420213

Please sign in to comment.