cookiecutter / cookiecutter-django

Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
https://cookiecutter-django.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12.05k stars 2.88k forks source link

Docker images wait-for-it command not found #5446

Open maxkokocom opened 22 hours ago

maxkokocom commented 22 hours ago

What happened?

When trying to run docker either by itself or via docker compose up on freshly generated project without any changes I am getting following errors:

django-1 | /entrypoint: line 19: wait-for-it: command not found celeryworker-1 | /entrypoint: line 19: wait-for-it: command not found celerybeat-1 | /entrypoint: line 19: wait-for-it: command not found flower-1 | /entrypoint: line 19: wait-for-it: command not found

I also have app failing to auth with postgres with user from .envs, I wonder should creating a user manually be added to docs/readme or have I missed something and it is in dockerfile scripts somewhere?

What should've happened instead?

Both docker compose and docker themselves should start in a working state on a fresh project.

Additional details

{
  "cookiecutter": {
    "project_name": "XXX",
    "project_slug": "xxx",
    "description": "yyy",
    "author_name": "yyy",
    "domain_name": "yyy.com",
    "email": "me@yyy.com",
    "version": "0.1.0",
    "open_source_license": "Not open source",
    "username_type": "username",
    "timezone": "UTC",
    "windows": "n",
    "editor": "PyCharm",
    "use_docker": "y",
    "postgresql_version": "16",
    "cloud_provider": "None",
    "mail_service": "Mailjet",
    "use_async": "n",
    "use_drf": "n",
    "frontend_pipeline": "Django Compressor",
    "use_celery": "y",
    "use_mailpit": "y",
    "use_sentry": "y",
    "use_whitenoise": "y",
    "use_heroku": "n",
    "ci_tool": "Gitlab",
    "keep_local_envs_in_vcs": "y",
    "debug": "n",
    "_template": "https://github.com/cookiecutter/cookiecutter-django",
    "_output_dir": "YYY",
    "_repo_dir": "YYY",
    "_checkout": null
  },
  "_cookiecutter": {
    "project_name": "My Awesome Project",
    "project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}",
    "description": "Behold My Awesome Project!",
    "author_name": "Daniel Roy Greenfeld",
    "domain_name": "example.com",
    "email": "{{ cookiecutter.author_name.lower() | trim() |replace(' ', '-') }}@{{ cookiecutter.domain_name.lower() | trim() }}",
    "version": "0.1.0",
    "open_source_license": [
      "MIT",
      "BSD",
      "GPLv3",
      "Apache Software License 2.0",
      "Not open source"
    ],
    "username_type": [
      "username",
      "email"
    ],
    "timezone": "UTC",
    "windows": "n",
    "editor": [
      "None",
      "PyCharm",
      "VS Code"
    ],
    "use_docker": "n",
    "postgresql_version": [
      "16",
      "15",
      "14",
      "13",
      "12"
    ],
    "cloud_provider": [
      "AWS",
      "GCP",
      "Azure",
      "None"
    ],
    "mail_service": [
      "Mailgun",
      "Amazon SES",
      "Mailjet",
      "Mandrill",
      "Postmark",
      "Sendgrid",
      "Brevo",
      "SparkPost",
      "Other SMTP"
    ],
    "use_async": "n",
    "use_drf": "n",
    "frontend_pipeline": [
      "None",
      "Django Compressor",
      "Gulp",
      "Webpack"
    ],
    "use_celery": "n",
    "use_mailpit": "n",
    "use_sentry": "n",
    "use_whitenoise": "n",
    "use_heroku": "n",
    "ci_tool": [
      "None",
      "Travis",
      "Gitlab",
      "Github",
      "Drone"
    ],
    "keep_local_envs_in_vcs": "y",
    "debug": "n"
  }
}% 
foarsitter commented 17 hours ago

wait-for-it is missing here: https://github.com/cookiecutter/cookiecutter-django/blob/8fb90ab02a8e20abafa9152616eb54a912617d1a/%7B%7Bcookiecutter.project_slug%7D%7D/compose/production/django/Dockerfile#L67-L75

It is added to the build step but it is required at runtime.

maxkokocom commented 15 hours ago

Sorry, does it mean version from 4 days ago is already working? What cookiecutter version is it? Or is this message tatgeted at someone else to add it somewhere else as well?

foarsitter commented 8 hours ago

wait-for-it is missing on that line, add it and it will work.