Answer the question
In order to leave comments, you need to log in
Why is there no access to a file inside a Docker container?
All good. I'm trying to package in a Django container.
FROM python:3.9
ENV PYTHONUNBUFFERED 1
WORKDIR /backend
ADD . /backend
COPY start.sh /backend/start.sh
RUN chmod +x ./start.sh
RUN pip install -r /backend/requirements.txt
# RUN ls -a
CMD ["/backend/start.sh"]
version: "3.9"
volumes:
db-data:
services:
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
ports:
- 5432:5432
environment:
- POSTGRES_DB=visionmark
- POSTGRES_USER=nariman
- [email protected]
volumes:
- db-data:/var/lib/postgresql/data
backend:
build: ./backend
volumes:
- .:/backend
expose:
- "8000"
depends_on:
- db
Answer the question
In order to leave comments, you need to log in
I have a question too. you copy the project to /backend in the Dockerfile, ok, I see.
why are you doing this in docker-compise -
volumes:
- .:/backend
i.e. you mount the contents of the working directory in /backend again
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question