File tree Expand file tree Collapse file tree 4 files changed +33
-5
lines changed Expand file tree Collapse file tree 4 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,5 @@ SELENIUM_PORT_1=4444
3
3
SELENIUM_PORT_2 = 5900
4
4
MAILCATCHER_PORT = 1080
5
5
RAILS_DB_ADAPTER = postgresql
6
+ POSTGRES_PORT = 5433
7
+ MYSQL_PORT = 3307
Original file line number Diff line number Diff line change 16
16
" kaiwood.endwise" ,
17
17
" mtxr.sqltools" ,
18
18
" mtxr.sqltools-driver-pg" ,
19
+ " mtxr.sqltools-driver-mysql" ,
19
20
" ms-vsliveshare.vsliveshare"
20
21
],
21
22
"settings" : {
30
31
"driver" : " PostgreSQL" ,
31
32
"name" : " app_development" ,
32
33
"database" : " app_development" ,
33
- "username" : " db_user" ,
34
- "password" : " password"
35
- }
34
+ "username" : " postgres" ,
35
+ "password" : " postgres"
36
+ },
37
+ {
38
+ "previewLimit" : 50 ,
39
+ "server" : " mysqldb" ,
40
+ "port" : 3306 ,
41
+ "driver" : " MySQL" ,
42
+ "name" : " app_development" ,
43
+ "database" : " app_development" ,
44
+ "username" : " root" ,
45
+ "password" : " password"
46
+ },
36
47
]
37
48
}
38
49
}
Original file line number Diff line number Diff line change @@ -10,15 +10,18 @@ services:
10
10
environment :
11
11
POSTGRES_USER : postgres
12
12
POSTGRES_PASSWORD : postgres
13
+ ports :
14
+ - $POSTGRES_PORT:5432
13
15
14
16
# MySQL
15
17
# mysqldb:
16
18
# image: mysql:5
19
+ # platform: linux/amd64
17
20
# restart: on-failure:5
18
21
# environment:
19
22
# MYSQL_ROOT_PASSWORD: password
20
- # MYSQL_PASSWORD: password
21
- # MYSQL_USER: db_user
23
+ # ports:
24
+ # - $MYSQL_PORT:3306
22
25
23
26
app :
24
27
build :
@@ -33,13 +36,22 @@ services:
33
36
# Optional Node.js version to install
34
37
NODE_VERSION : " 14"
35
38
environment :
39
+ # PostgreSQL
36
40
RAILS_DB_ADAPTER : postgresql
37
41
RAILS_DB_HOST : postgresdb
38
42
RAILS_DB : app
39
43
RAILS_DB_USERNAME : postgres
40
44
RAILS_DB_PASSWORD : postgres
41
45
RAILS_DB_ENCODING : utf8
42
46
RAILS_ENV : development
47
+ # # MySQL
48
+ # RAILS_DB_ADAPTER: mysql2
49
+ # RAILS_DB_HOST: mysqldb
50
+ # RAILS_DB: app
51
+ # RAILS_DB_USERNAME: root
52
+ # RAILS_DB_PASSWORD: password
53
+ # RAILS_DB_ENCODING: utf8mb4
54
+ # RAILS_ENV: development
43
55
env_file : .env
44
56
tty : true
45
57
ports :
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ SELENIUM_PORT_2=5900
70
70
MAILCATCHER_PORT=1080
71
71
# mysqlやsqlite3に変えても良い。mysqlの場合、.devcontainer/docker-compose.ymlのMySQL関連のコメントアウトを外す
72
72
RAILS_DB_ADAPTER=postgresql
73
+ # postgres、mysqlのホスト側への公開ポート。ホスト側で既に使っている場合は変える
74
+ POSTGRES_PORT=5433
75
+ MYSQL_PORT=3307
73
76
```
74
77
75
78
* VScodeに拡張機能[ Remote-Containers] ( https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers ) をインストール
You can’t perform that action at this time.
0 commit comments