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

Đang mở Phù hợp với người mới
#2,477 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Anurag-S1ngh đang làm issue này rồi.

Từ ngày 24/10/2026.

  • #2481 của @saksham-rathore — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
77/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker-compose, python
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Bắt đầu với docker-compose.yml và .dockerignore; kiểm tra các đích chờ của scheduler và worker, cấu hình env_file khi chạy và khóa phiên bản Compose đã lỗi thời được mô tả trong issue. Chạy thiết lập Docker Compose để xác nhận worker chờ vulnerablecode:8000 và các container nhận được những biến môi trường cần thiết khi chạy. Hoàn tất khi lỗi khởi động và cảnh báo ngừng hỗ trợ được xử lý, kể cả với các thiết lập sử dụng /etc/vulnerablecode/.env.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
716
Fork
347
Merge trung bình
13 giờ 47 phút
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aboutcode-org/vulnerablecode

Tất cả issue của aboutcode-org/vulnerablecode

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.