File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,31 @@ const gitignoreFileContent = `.remote
4545node_modules
4646` ;
4747
48+ const dockerfilePath = path . join ( rootDir , "Dockerfile" ) ;
49+ const dockerfileContent = `FROM node:20-alpine3.17
50+
51+ WORKDIR /qiita
52+
53+ EXPOSE 8888
54+ ` ;
55+
56+ const dockerComposeFilePath = path . join ( rootDir , "docker-compose.yml" ) ;
57+ const dockerComposeFileContent = `version: "3"
58+ services:
59+ qiita:
60+ container_name: qiita
61+ build:
62+ context: .
63+ dockerfile: ./Dockerfile
64+ ports:
65+ - 8888:8888
66+ tty: true
67+ volumes:
68+ - ./:/qiita
69+ environment:
70+ TZ: Asia/Tokyo
71+ ` ;
72+
4873export const init = async ( ) => {
4974 console . log ( "設定ファイルを生成します。\n" ) ;
5075
@@ -54,6 +79,10 @@ export const init = async () => {
5479 writeFile ( publishWorkflowFilePath , publishWorkflowFileContent ) ;
5580 writeFile ( gitignoreFilePath , gitignoreFileContent ) ;
5681
82+ //docker
83+ writeFile ( dockerfilePath , dockerfileContent ) ;
84+ writeFile ( dockerComposeFilePath , dockerComposeFileContent ) ;
85+
5786 const userConfigFilePath = config . getUserConfigFilePath ( ) ;
5887 const userConfigDir = config . getUserConfigDir ( ) ;
5988 if ( ! fs . existsSync ( userConfigFilePath ) ) {
You can’t perform that action at this time.
0 commit comments