0

This is the DockerFile

FROM python:3.10.1

ENV APP_ROOT /app
ENV CONFIG_ROOT /config

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN mkdir ${CONFIG_ROOT}
COPY requirements.txt ${CONFIG_ROOT}/requirements.txt
COPY firebase.json ${CONFIG_ROOT}/firebase.json
RUN pip install -r ${CONFIG_ROOT}/requirements.txt
RUN python -m spacy download en_core_web_sm

RUN mkdir ${APP_ROOT}
WORKDIR ${APP_ROOT}

ADD . ${APP_ROOT}

And below is the docker-compose.yml file:

version: "3.7"

services:

  postgres:
    container_name: postgres_container
    image: postgres:14.6
    environment:
      POSTGRES_USER: xyz
      POSTGRES_PASSWORD: xyz
      POSTGRES_DB: xyz
      PGDATA: /data/postgres
    volumes:
       - ./dev-volume/postgres:/data/postgres
    ports:
      - "5432:5432"
    networks:
      - postgres
    restart: unless-stopped

  web:
    build: .
    container_name: web
    restart: always
    env_file:
      - .env.dev
    ports:
      - "8000:8000"
    volumes:
      - ./dev-volume/static/:/app/static
      - ./dev-volume/media/:/app/media
      - ./dev-volume/db:/db
    entrypoint: /app/wsgi-entrypoint.sh

    command:
      "gunicorn --workers=2 --bind=0.0.0.0:8000 picard.wsgi:application"
    depends_on:
      - postgres
    networks:
      - postgres

  nginx:
    image: nginx:latest
    container_name: ngx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./static/:/static
      - ./media/:/media
      - ./nginx/dev:/etc/nginx/conf.d
    depends_on:
      - web
    networks:
      - postgres


networks:
    postgres:
      driver: bridge

So these are both the files, when I run docker compose up --build in Linux, it works fine but when I try to do the same in windows I get the error

exec /app/wsgi-entrypoint.sh: no such file or directory

sh file is in the app directory only. But somehow windows is not able to find it. It works fine in Linux but not in windows.

I have tried this solution But it isn't working. And I have tried changing paths but none of them is working.

Omega
  • 1
  • 2
    Have you tried to switch your docker into linux mode using `Switch to Linux containers...` ? – RezaNoei May 12 '23 at 09:22
  • 1
    That's often a symptom of trying to run a Linux container, but the script in your container has Windows line endings. Several of the answers to [Why won't my docker-entrypoint.sh execute?](https://stackoverflow.com/questions/38905135/why-wont-my-docker-entrypoint-sh-execute) discuss this further. – David Maze May 12 '23 at 10:24
  • There are many more similar questions with multiple possible reasons on SO. Eg. did you try this answer: https://stackoverflow.com/a/62662153/18667225 ? Please share more debugging details what you have tried so far. – Markus May 12 '23 at 23:04

0 Answers0