Ошибка при использовании команды CMD ["gunicorn", "foodgram.wsgi:application", "--bind", "0:8000"].

Я использую docker-compose на Windows 10 19044.1766 для запуска контейнеров. Контейнер backend постоянно перезапускается с ошибкой:

standard_init_linux.go:228: exec user process caused: exec format ошибка

dockerfile:

FROM python:3.8-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt --no-cache-dir
COPY . /app
CMD ["gunicorn", "foodgram.wsgi:application", "--bind,", "0:8000"]

я пробовал: CMD ["gunicorn", "foodgram.wsgi:application", "--bind", "0:8000"], CMD gunicorn foodgram.wsgi:application --bind 0:8000, CMD ["gunicorn", "foodgram.wsgi:application", "--bind", "0.0.0.0:8000"] та же ошибка

docker-compose.yml

version: '3.3'

volumes:
  postgres_data:
  static:
  media:
  static_value:
  media_value:
  frontend_data:

services:
  db:
    image: postgres:12.4
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    env_file:
      - ../backend/.env
  
  backend:
    image: mastermind777nest/foodgram:latest
    restart: always
    volumes:
      - static_value:/app/static/
      - media_value:/app/media/
    depends_on:
      - db
    env_file:
      - ../backend/.env

  frontend:
    build:
      context: ../frontend
      dockerfile: Dockerfile
    volumes:
      - ../frontend/:/app/result_build/

  nginx:
    image: nginx:1.19.3
    ports:
      - "10080:80"
      - "10443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ../frontend/build:/usr/share/nginx/html/
      - ../docs/:/usr/share/nginx/html/api/docs/
      - static:/app/static/
      - media:/app/media/
      - static_value:/var/html/static/
      - media_value:/var/html/media/
    restart: always
    depends_on:
      - backend
      - frontend

Структура

enter image description here

Это возможно, если образ был собран на архитектуре ARM (или Windows) и перенесен на обычный Linux-сервер. Соберите образ непосредственно на сервере.

Вернуться на верх