Docker Compose setup fails on wait-for-it host web:8000 and missing runtime .env

オープン 初心者向け
#2,477 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Anurag-S1ngh がすでに取り組んでいます。

2026年10月24日 から。

  • #2481 @saksham-rathore による — オープン

評価

難易度
2/5
見積もり時間
半日
初心者へのやさしさ
77/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker-compose, python

調査の方向性

まず docker-compose.yml と .dockerignore を確認し、scheduler と worker の待機先、実行時の env_file 設定、issue に記載された古い Compose バージョンキーを調べます。Docker Compose のセットアップを実行し、worker が vulnerablecode:8000 を待機することと、コンテナが必要な実行時環境変数を受け取ることを確認します。/etc/vulnerablecode/.env を使用するセットアップも含め、起動失敗と非推奨警告が解消されたら完了です。

索引モデルが issue の本文から書いたものです。

説明

While setting up VulnerableCode locally with Docker Compose, I hit a few issues in docker-compose.yml and .dockerignore:

  1. Scheduler and RQ workers wait on web:8000 instead of vulnerablecode:8000
    vulnerablecode_scheduler, vulnerablecode_rqworker, and vulnerablecode_rqworker_high run wait-for-it web:8000, which does not match any service name in docker-compose.yml (nginx proxies to vulnerablecode:8000). On startup, all three time out:

    vulnerablecode_rqworker-1       | wait-for-it: timeout occurred after waiting 15 seconds for web:8000
    vulnerablecode_rqworker_high-1  | wait-for-it: timeout occurred after waiting 15 seconds for web:8000
    vulnerablecode_scheduler-1      | wait-for-it: timeout occurred after waiting 15 seconds for web:8000
    

    Updating this to wait-for-it -t 60 vulnerablecode:8000 waits on the actual service and allows initial migrations to finish before workers start.

  2. .env is not loaded via env_file at container runtime (and is missing from .dockerignore)
    docker-compose.yml currently only specifies docker.env under env_file. If images are built before make envfile is run, all application and worker containers exit immediately on startup:

    django.core.exceptions.ImproperlyConfigured: Set the SECRET_KEY environment variable
    

    Adding .env to .dockerignore (alongside docker.env) keeps build layers clean, and loading .env with required: false in docker-compose.yml passes SECRET_KEY and ALTCHA_HMAC_KEY at runtime without breaking setups that use /etc/vulnerablecode/.env.

  3. Obsolete top-level version: "3" key
    Docker Compose v2 logs a deprecation warning on every command until version: "3" is removed.

I have tested these fixes locally and will open a PR with a regression test shortly.

主要言語
Python
スター
716
フォーク
347
平均マージ
13時間 47分
マージ済み PR(30日)
8

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aboutcode-org/vulnerablecode のほかの issue

aboutcode-org/vulnerablecode の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。