P
P
PtrGrd2021-11-13 19:59:11
Docker
PtrGrd, 2021-11-13 19:59:11

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"

Dockerfile
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"]


General structure of the project
.
├── docker-compose.yml
└── script
    ├── Dockerfile
    ├── requirements.txt
    ├── res
    │   ├── text.txt
    └── src
        ├── config.ini
        ├── main.session
        ├── script.py
        └── settings.json


Thank you in advance for your help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-11-13
@karabanov

Space in path:./ .database/postgres/data

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question