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
45
45
node_modules
46
46
` ;
47
47
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
+
48
73
export const init = async ( ) => {
49
74
console . log ( "設定ファイルを生成します。\n" ) ;
50
75
@@ -54,6 +79,10 @@ export const init = async () => {
54
79
writeFile ( publishWorkflowFilePath , publishWorkflowFileContent ) ;
55
80
writeFile ( gitignoreFilePath , gitignoreFileContent ) ;
56
81
82
+ //docker
83
+ writeFile ( dockerfilePath , dockerfileContent ) ;
84
+ writeFile ( dockerComposeFilePath , dockerComposeFileContent ) ;
85
+
57
86
const userConfigFilePath = config . getUserConfigFilePath ( ) ;
58
87
const userConfigDir = config . getUserConfigDir ( ) ;
59
88
if ( ! fs . existsSync ( userConfigFilePath ) ) {
You can’t perform that action at this time.
0 commit comments