Answer the question
In order to leave comments, you need to log in
docker-compose not seeing postgres?
The essence of the problem: docker-compose suddenly started to give an error from nothing:
Error response from daemon: invalid volume specification: '/home/user/Desktop/Project_n1/ .database/postgres/data:/database/postgres/data:rw'
docker -compose
version: '3.8'
services:
script:
build: ./script/
command: /script/src/script.py
container_name: script-mtg
depends_on:
- db
volumes:
- ./script/src/settings.json:/script/src/settings.json
- ./script/res/text.txt:/script/res/text.txt
- ./script/res/time.txt:/script/res/time.txt
db:
image: postgres:latest
container_name: dbpg-mtg
restart: always
volumes:
- ./ .database/postgres/data:/var/lib/postgresql/data
ports:
- "5432"
FROM python:latest
WORKDIR /script/src
COPY ./ /script
COPY requirements.txt /script
COPY src /script/src
RUN apt-get update && apt-get install -y python3-pip
RUN pip install -r /script/requirements.txt
RUN chmod +x /script/src/script.py
CMD ["python3", "/script/src/script.py"]
.
├── docker-compose.yml
└── script
├── Dockerfile
├── requirements.txt
├── res
│ ├── text.txt
└── src
├── config.ini
├── main.session
├── script.py
└── settings.json
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question