Docker: standard_init_linux.go:228: exec user process caused: no such file or directory

Viewed 718

I got this docker file:

version: "3.7"


x-web-environment: &web-environment
  environment:
    - PORT=8000
    - ENVIRONMENT_NAME=local_dev
    - USING_DOCKER_COMPOSE=true
    - DJANGO_SETTINGS_MODULE=backend.settings.dev
    - DJANGO_CONFIGURATION=Local
    - DJANGO_ALLOWED_HOSTS=web,localhost
    - DJANGO_CORS_ORIGIN_WHITELIST
    - DJANGO_ADMIN_URL=***
    - POSTGRES_USER=documentcrawler
    - POSTGRES_PASSWORD=*****
    - POSTGRES_HOST=postgres
    - POSTGRES_DB=****
    - DJANGO_SECRET_KEY=*******************
    - REDIS_SERVER_IP=redis
  build:
    context: ./
    dockerfile: Dockerfile.api
  volumes:
    - type: bind
      source: ./
      target: /code
    - type: bind
      source: /tmp
      target: /tmp

services:

  postgres:
    restart: always
    image: postgres:14
    environment:
      - POSTGRES_USER=****
      - POSTGRES_PASSWORD=****
      - POSTGRES_HOST=*****
      - POSTGRES_DB=****
      - PGDATA=/data/pgdata
    volumes:
      - ./pgdata:/data/pgdata
    ports:
      - "5433:5432"

  redis:
    restart: always
    image: redis:latest
    ports:
      - "6379:6379"

  rabbitmq:
    restart: always
    image: rabbitmq:3.9
    environment:
      - RABBITMQ_DEFAULT_USER=****
      - RABBITMQ_DEFAULT_PASS=****
    ports:
      - "5432:5432"


  api:
    <<: *web-environment
    restart: always
    ports:
      - "8000:8000"
    command: "scripts/local/run_web.sh"

  app:
    restart: always
    ports:
      - "3000:3000"
    environment:
      - API_URL=http://api:8000
      - INTERNAL_API_URL=http://api:8000
    build:
      context: ./
      dockerfile: Dockerfile.app

  ctaima:
    <<: *web-environment
    restart: always
    build:
      context: .
      dockerfile: Dockerfile
    command: ["dramatiq", "-p", "1", "-t", "1", "crawler.tasks.broker:rabbitmq_broker", "--queues", "ctaima"]
    shm_size: "4gb"


  redis:
    image: redis:alpine
    ports:
      - "6379:6379"

My Dockerfile.api:

FROM python:3.8
ENV PYTHONUNBUFFERED 1

# Add system dependencies
RUN apt update && apt install postgresql gcc python3-dev musl-dev libffi-dev make python3-watchdog -y

# Allows docker to cache installed dependencies between builds
COPY Pipfile* ./
RUN pip install pipenv
RUN pipenv install --dev --system --deploy --ignore-pipfile

# Adds our application code to the image
COPY . /code/
WORKDIR /code

# Expose Django's port
EXPOSE $PORT
#CMD "scripts/local/run_web.sh"
CMD "scripts/local/run_web.sh"

My tree:

scripts/local/run_web.sh
scripts/local/wait_for_postgres.py
scripts/prod/run_web.sh

All containers work perfectly except the API container that generates the error "standard_init_linux.go:228: exec user process caused: no such file or directory"

How can i fix that? thanks u so much!

It is an inherited project that is not mine and I don't know how I can solve it, I hope you can give me a hand.

0 Answers
Related