Python Forum
Issue in Starting Django project with Docker
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue in Starting Django project with Docker
#1
Hello Python Geeks,

Looking for geeks' insight for django-docker related issues. I'm not able to run the command "docker-compose run --rm app sh -c "django-admin startproject app ."

Error:
Traceback (most recent call last): File "/py/bin/django-admin", line 8, in <module> sys.exit(execute_from_command_line()) File "/py/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/py/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/py/lib/python3.9/site-packages/django/core/management/commands/startproject.py", line 21, in handle super().handle('project', project_name, target, **options) File "/py/lib/python3.9/site-packages/django/core/management/templates.py", line 160, in handle with open(new_path, 'w', encoding='utf-8') as new_file: PermissionError: [Errno 13] Permission denied: '/app/manage.py'
Quote:Adding docker related content

FROM python:3.9-alpine3.13
LABEL maintainer="prabakaran141"

ENV PYTHONUNBUFFERED 1

COPY ./requirements.txt /tmp/requirements.txt
COPY ./requirements.dev.txt /tmp/requirements.dev.txt
COPY ./app /app
WORKDIR /app
EXPOSE 8000

ARG DEV=false
RUN python -m venv /py && \
/py/bin/pip install --upgrade pip && \
/py/bin/pip install -r /tmp/requirements.txt && \
if [ $DEV = "true" ]; \
then /py/bin/pip install -r /tmp/requirements.dev.txt ; \
fi && \
rm -rf /tmp && \
adduser \
--disabled-password \
--no-create-home \
django-user

ENV PATH="/py/bin:$PATH"

USER django-user



I have followed some links in stackoverflow, which didn't work.
https://stackoverflow.com/questions/7353...-manage-py,
https://stackoverflow.com/questions/5572...rying-to-c

Will be waiting for your valuable inputs.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb shutdown host from docker container cosmin1805 0 1,678 Nov-27-2022, 06:34 PM
Last Post: cosmin1805
  Docker -building a python image saisankalpj 5 7,378 Jul-13-2022, 12:53 PM
Last Post: saisankalpj
  Docker-compose on Pycharm - Connection refused rstambach 3 4,564 Apr-08-2021, 03:07 AM
Last Post: rstambach
  Cannot bring up anaconda in Docker image ErnestTBass 1 2,592 Aug-15-2020, 04:12 AM
Last Post: ndc85430
  Issue starting Python on VSC (Nooby) Buggy 1 2,678 Mar-14-2019, 09:44 PM
Last Post: snippsat
  Wine / liquor dispenser project code issue onlinegill 0 2,621 Nov-20-2018, 10:41 PM
Last Post: onlinegill

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020