Skip to content

Conversation

@miolab
Copy link
Owner

@miolab miolab commented Nov 12, 2020

概要

現状では、ローカル開発環境(macOS)において、 'docker-compose up' でのPostgresコンテナ起動が失敗するケースが発生しているため、これを解決する

  • クラウド環境(Linux)
  • CIビルド

では問題なくビルド成功しているので、ローカルでも起動できるよう微修正を加えていく

上記事情があるため、既存ファイルにはなるべく手をつけず(最小限の修正で)解決できるよう改善実装する

参考

リポジトリ miolab/psql_docker_sandbox#2 で検証完了しており、こちらの実装結果をもとに進めていく

@miolab miolab linked an issue Nov 12, 2020 that may be closed by this pull request
@miolab
Copy link
Owner Author

miolab commented Nov 13, 2020

  • CI 通過

  • ローカルで以下実行できることも確認できたため、マージします

$ docker-compose exec db bash
bash-5.0# psql -U postgres
psql (12.4)
Type "help" for help.

postgres=# \l
                                 List of databases
   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
-----------+----------+----------+------------+------------+-----------------------
 postgres  | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | 
 template0 | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | =c/postgres          +
           |          |          |            |            | postgres=CTc/postgres
 template1 | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | =c/postgres          +
           |          |          |            |            | postgres=CTc/postgres
 testdb    | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | 
(4 rows)

postgres=# create database test;
CREATE DATABASE

postgres=# \l
                                 List of databases
   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
-----------+----------+----------+------------+------------+-----------------------
 postgres  | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | 
 template0 | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | =c/postgres          +
           |          |          |            |            | postgres=CTc/postgres
 template1 | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | =c/postgres          +
           |          |          |            |            | postgres=CTc/postgres
 test      | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | 
 testdb    | postgres | UTF8     | ja_JP.utf8 | ja_JP.utf8 | 
(5 rows)

postgres=# 

(DBに接続し、create databaseできていることを確認)

@miolab
Copy link
Owner Author

miolab commented Nov 13, 2020

app と db コンテナ間の接続は、別PRつくってからやる

@miolab miolab merged commit 218d8da into main Nov 13, 2020
@miolab
Copy link
Owner Author

miolab commented Nov 13, 2020

↑↑を、新PR #18 で着手

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ローカルPostgreSQLコンテナのbuildがコケる問題

2 participants