質問編集履歴
2
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -21,6 +21,96 @@
|
|
21
21
|
volumes:
|
22
22
|
datavol:
|
23
23
|
```
|
24
|
+
追記(04/12/18:37)
|
25
|
+
database.yamlは以下のようになります
|
26
|
+
```
|
27
|
+
# PostgreSQL. Versions 9.3 and up are supported.
|
28
|
+
#
|
29
|
+
# Install the pg driver:
|
30
|
+
# gem install pg
|
31
|
+
# On macOS with Homebrew:
|
32
|
+
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
33
|
+
# On macOS with MacPorts:
|
34
|
+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
35
|
+
# On Windows:
|
36
|
+
# gem install pg
|
37
|
+
# Choose the win32 build.
|
38
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
39
|
+
#
|
40
|
+
# Configure Using Gemfile
|
41
|
+
# gem 'pg'
|
42
|
+
#
|
43
|
+
default: &default
|
44
|
+
adapter: postgresql
|
45
|
+
encoding: unicode
|
46
|
+
# For details on connection pooling, see Rails configuration guide
|
47
|
+
# https://guides.rubyonrails.org/configuring.html#database-pooling
|
48
|
+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
49
|
+
|
50
|
+
development:
|
51
|
+
<<: *default
|
52
|
+
database: bokin_back_development
|
53
|
+
|
54
|
+
# The specified database role being used to connect to postgres.
|
55
|
+
# To create additional roles in postgres see `$ createuser --help`.
|
56
|
+
# When left blank, postgres will use the default role. This is
|
57
|
+
# the same name as the operating system user that initialized the database.
|
58
|
+
#username: bokin_back
|
59
|
+
|
60
|
+
# The password associated with the postgres role (username).
|
61
|
+
#password:
|
62
|
+
|
63
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
64
|
+
# domain socket that doesn't need configuration. Windows does not have
|
65
|
+
# domain sockets, so uncomment these lines.
|
66
|
+
#host: localhost
|
67
|
+
|
68
|
+
# The TCP port the server listens on. Defaults to 5432.
|
69
|
+
# If your server runs on a different port number, change accordingly.
|
70
|
+
#port: 5432
|
71
|
+
|
72
|
+
# Schema search path. The server defaults to $user,public
|
73
|
+
#schema_search_path: myapp,sharedapp,public
|
74
|
+
|
75
|
+
# Minimum log levels, in increasing order:
|
76
|
+
# debug5, debug4, debug3, debug2, debug1,
|
77
|
+
# log, notice, warning, error, fatal, and panic
|
78
|
+
# Defaults to warning.
|
79
|
+
#min_messages: notice
|
80
|
+
|
81
|
+
# Warning: The database defined as "test" will be erased and
|
82
|
+
# re-generated from your development database when you run "rake".
|
83
|
+
# Do not set this db to the same as development or production.
|
84
|
+
test:
|
85
|
+
<<: *default
|
86
|
+
database: bokin_back_test
|
87
|
+
|
88
|
+
# As with config/credentials.yml, you never want to store sensitive information,
|
89
|
+
# like your database password, in your source code. If your source code is
|
90
|
+
# ever seen by anyone, they now have access to your database.
|
91
|
+
#
|
92
|
+
# Instead, provide the password as a unix environment variable when you boot
|
93
|
+
# the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
|
94
|
+
# for a full rundown on how to provide these environment variables in a
|
95
|
+
# production deployment.
|
96
|
+
#
|
97
|
+
# On Heroku and other platform providers, you may have a full connection URL
|
98
|
+
# available as an environment variable. For example:
|
99
|
+
#
|
100
|
+
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
101
|
+
#
|
102
|
+
# You can use this database configuration with:
|
103
|
+
#
|
104
|
+
# production:
|
105
|
+
# url: <%= ENV['DATABASE_URL'] %>
|
106
|
+
#
|
107
|
+
production:
|
108
|
+
<<: *default
|
109
|
+
database: bokin_back_production
|
110
|
+
username: bokin_back
|
111
|
+
password: <%= ENV['BOKIN_BACK_DATABASE_PASSWORD'] %>
|
112
|
+
|
113
|
+
```
|
24
114
|
zshの環境変数にはPOSGRES_USERとPOSGRES_PASSWORDを記述しました.
|
25
115
|
|
26
116
|
開発ディレクトリにて、`docker-compose up -d`を実行して
|
1
環境
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
#環境
|
2
|
+
Mac os Catalina -v10.15.4
|
3
|
+
Ruby Mine
|
1
4
|
#やりたいこと
|
2
5
|
RailsのAPIをDockerでpostgresを動かしながら作成しようとしています
|
3
6
|
docker-compose.ymlは以下のようになります。
|