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
33SELENIUM_PORT_2 = 5900
44MAILCATCHER_PORT = 1080
55RAILS_DB_ADAPTER = postgresql
6+ POSTGRES_PORT = 5433
7+ MYSQL_PORT = 3307
Original file line number Diff line number Diff line change 1616 " kaiwood.endwise" ,
1717 " mtxr.sqltools" ,
1818 " mtxr.sqltools-driver-pg" ,
19+ " mtxr.sqltools-driver-mysql" ,
1920 " ms-vsliveshare.vsliveshare"
2021 ],
2122 "settings" : {
3031 "driver" : " PostgreSQL" ,
3132 "name" : " app_development" ,
3233 "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+ },
3647 ]
3748 }
3849 }
Original file line number Diff line number Diff line change @@ -10,15 +10,18 @@ services:
1010 environment :
1111 POSTGRES_USER : postgres
1212 POSTGRES_PASSWORD : postgres
13+ ports :
14+ - $POSTGRES_PORT:5432
1315
1416 # MySQL
1517 # mysqldb:
1618 # image: mysql:5
19+ # platform: linux/amd64
1720 # restart: on-failure:5
1821 # environment:
1922 # MYSQL_ROOT_PASSWORD: password
20- # MYSQL_PASSWORD: password
21- # MYSQL_USER: db_user
23+ # ports:
24+ # - $MYSQL_PORT:3306
2225
2326 app :
2427 build :
@@ -33,13 +36,22 @@ services:
3336 # Optional Node.js version to install
3437 NODE_VERSION : " 14"
3538 environment :
39+ # PostgreSQL
3640 RAILS_DB_ADAPTER : postgresql
3741 RAILS_DB_HOST : postgresdb
3842 RAILS_DB : app
3943 RAILS_DB_USERNAME : postgres
4044 RAILS_DB_PASSWORD : postgres
4145 RAILS_DB_ENCODING : utf8
4246 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
4355 env_file : .env
4456 tty : true
4557 ports :
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ SELENIUM_PORT_2=5900
7070MAILCATCHER_PORT=1080
7171# mysqlやsqlite3に変えても良い。mysqlの場合、.devcontainer/docker-compose.ymlのMySQL関連のコメントアウトを外す
7272RAILS_DB_ADAPTER=postgresql
73+ # postgres、mysqlのホスト側への公開ポート。ホスト側で既に使っている場合は変える
74+ POSTGRES_PORT=5433
75+ MYSQL_PORT=3307
7376```
7477
7578* 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