File tree 4 files changed +69
-10
lines changed
4 files changed +69
-10
lines changed Original file line number Diff line number Diff line change
1
+ // Update the VARIANT arg in docker-compose.yml to pick a Node.js version
2
+ {
3
+ "name" : " Node.js && Redis && MySQL" ,
4
+ "dockerComposeFile" : " ../docker-compose.yml" ,
5
+ "service" : " app" ,
6
+ "workspaceFolder" : " /workspaces/${localWorkspaceFolderBasename}" ,
7
+
8
+ // Configure tool-specific properties.
9
+ "customizations" : {
10
+ // Configure properties specific to VS Code.
11
+ "vscode" : {
12
+ // Add the IDs of extensions you want installed when the container is created.
13
+ "extensions" : [
14
+ ]
15
+ }
16
+ },
17
+
18
+ "forwardPorts" : [
19
+ " phpmyadmin:80"
20
+ ],
21
+
22
+ // Use 'postCreateCommand' to run commands after the container is created.
23
+ "postCreateCommand" : " pnpm i" ,
24
+ "containerEnv" : {
25
+ "MYSQL_HOST" : " mysql"
26
+ },
27
+
28
+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
29
+ "remoteUser" : " node"
30
+ }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ lerna-debug.log*
8
8
9
9
.npmrc
10
10
package-lock.json
11
+ pnpm-lock.yaml
11
12
12
13
config /config.prod.ts
13
14
config /** /* .js
Original file line number Diff line number Diff line change 1
- version : ' 3.6 '
1
+ version : ' 3.8 '
2
2
services :
3
+ app :
4
+ build :
5
+ context : .
6
+ dockerfile : Dockerfile
7
+ volumes :
8
+ - ../..:/workspaces:cached
9
+
10
+ # Overrides default command so things don't shut down after the process ends.
11
+ command : sleep infinity
12
+
13
+ # links:
14
+ # - redis
15
+ # - mysql
16
+ depends_on :
17
+ - mysql
18
+ - redis
19
+ networks :
20
+ - cnpm
21
+
22
+ # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
23
+ # networks:
24
+ # - cnpm
25
+
26
+ # Uncomment the next line to use a non-root user for all processes.
27
+ # user: node
28
+
29
+ # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
30
+ # (Adding the "ports" property to this file will not forward from a Codespace.)
31
+
3
32
redis :
4
33
image : redis:6-alpine
5
34
# command: redis-server --appendonly yes --requirepass cnpm
6
35
restart : always
7
36
volumes :
8
37
- cnpm-redis:/data
9
38
ports :
10
- - 6379:6379
39
+ - 6379
11
40
networks :
12
41
- cnpm
13
42
@@ -16,7 +45,7 @@ services:
16
45
command : --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
17
46
restart : always
18
47
environment :
19
- MYSQL_ROOT_PASSWORD :
48
+ MYSQL_ROOT_PASSWORD : root
20
49
MYSQL_ALLOW_EMPTY_PASSWORD : ' yes'
21
50
# MYSQL_DATABASE: 'cnpmcore_unittest'
22
51
MYSQL_USER : user
@@ -26,7 +55,7 @@ services:
26
55
# - ./conf.d/mysql/:/etc/mysql/conf.d
27
56
# - ./init.d/mysql/:/docker-entrypoint-initdb.d
28
57
ports :
29
- - 3306:3306
58
+ - 3306
30
59
networks :
31
60
- cnpm
32
61
@@ -35,23 +64,22 @@ services:
35
64
image : phpmyadmin
36
65
restart : always
37
66
environment :
38
- MYSQL_ROOT_PASSWORD :
67
+ MYSQL_ROOT_PASSWORD : root
39
68
MYSQL_ALLOW_EMPTY_PASSWORD : ' yes'
40
69
MYSQL_USER : user
41
70
MYSQL_PASSWORD : pass
42
71
PMA_HOST : ' mysql'
72
+ depends_on :
73
+ - mysql
43
74
ports :
44
- - 8080: 80
75
+ - 80
45
76
networks :
46
77
- cnpm
47
- depends_on :
48
- - mysql
49
78
50
79
volumes :
51
80
cnpm-redis :
52
81
cnpm-mysql :
53
82
54
-
55
83
networks :
56
84
cnpm :
57
85
name : cnpm
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export class TestUtil {
49
49
host : process . env . MYSQL_HOST || '127.0.0.1' ,
50
50
port : process . env . MYSQL_PORT || 3306 ,
51
51
user : process . env . MYSQL_USER || 'root' ,
52
- password : process . env . MYSQL_PASSWORD ,
52
+ password : process . env . MYSQL_PASSWORD || '' ,
53
53
multipleStatements : true ,
54
54
} ;
55
55
}
You can’t perform that action at this time.
0 commit comments