###現状
私はdookiecutter-djangoを使用して
テンプレートのフォルダを作成しました。
その際に作成されたcomposeファイルを起動しようとしましたが
Waiting for PostgreSQL to become available
と繰り返し表示されてしまいます。
###コード
log
(venv) $ docker-compose -f local.yml up Starting apasn_postgres_1 ... done Starting apasn_django_1 ... done Attaching to apasn_postgres_1, apasn_django_1 postgres_1 | 2019-11-27 11:29:47.810 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres_1 | 2019-11-27 11:29:47.810 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres_1 | 2019-11-27 11:29:47.818 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres_1 | 2019-11-27 11:29:47.835 UTC [23] LOG: database system was shut down at 2019-11-27 11:29:42 UTC postgres_1 | 2019-11-27 11:29:47.839 UTC [1] LOG: database system is ready to accept connections django_1 | Waiting for PostgreSQL to become available... django_1 | Waiting for PostgreSQL to become available... django_1 | Waiting for PostgreSQL to become available... ...このまま続きます。
**local.yml **
version: '3' volumes: local_postgres_data: {} local_postgres_data_backups: {} services: django: build: context: . dockerfile: ./compose/local/django/Dockerfile image: apasn_local_django depends_on: - postgres volumes: - .:/app env_file: - ./.envs/.local/.django - ./.envs/.local/.postgres ports: - "8000:8000" command: /start postgres: build: context: . dockerfile: ./compose/production/postgres/Dockerfile image: apasn_production_postgres volumes: - local_postgres_data:/var/lib/postgresql/data - local_postgres_data_backups:/backups env_file: - ./.envs/.local/.postgres
Dockerfile
FROM postgres:11.3 COPY ./compose/production/postgres/maintenance /usr/local/bin/maintenance RUN chmod +x /usr/local/bin/maintenance/* RUN mv /usr/local/bin/maintenance/* /usr/local/bin \ && rmdir /usr/local/bin/maintenance
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/11/27 12:33