inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)

도커를 이용한 Postgres 실행

docker-compose up 명령어 날리면 에러 발생

1279

현석오

작성한 질문수 53

0

에러 내용이 아래와 같은데 조취 방법좀 알려주세요

 

질문 두가지는 현재 docker 는 설치 되있긴 한데 docer-compose 는 설치 된건지 모르겠고 .env 유저 아이디와 비밀번호는 .env 에 임의로 설정하면 되나요?

 

.env:

DB_USER_ID=postgres
DB_USER_PASSWORD=1234

 

docker-compose.yml:

version: '3'
services:
    db:
      image: postgres:latest
      container_name: postgres
      restart: always
      ports:
        - "5432:5432"
      environment:
        POSTGRES_USER: ${DB_USER_ID}
        POSTGRES_PASSWORD: ${DB_USER_PASSWORD}
      volumes:
        - ./data:/var/lib/postgresql/data

 

실행 test

(base) sizl@sizlui-MacBookPro server % docker-compose up
Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 670, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1255, in request
  File "http/client.py", line 1301, in _send_request
  File "http/client.py", line 1250, in endheaders
  File "http/client.py", line 1010, in _send_output
  File "http/client.py", line 950, in send
  File "docker/transport/unixconn.py", line 43, in connect
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 439, in send
  File "urllib3/connectionpool.py", line 726, in urlopen
  File "urllib3/util/retry.py", line 410, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 670, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1255, in request
  File "http/client.py", line 1301, in _send_request
  File "http/client.py", line 1250, in endheaders
  File "http/client.py", line 1010, in _send_output
  File "http/client.py", line 950, in send
  File "docker/transport/unixconn.py", line 43, in connect
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 214, in _retrieve_server_version
  File "docker/api/daemon.py", line 181, in version
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 237, in _get
  File "requests/sessions.py", line 543, in get
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 81, in main
  File "compose/cli/main.py", line 200, in perform_command
  File "compose/cli/command.py", line 60, in project_from_options
  File "compose/cli/command.py", line 152, in get_project
  File "compose/cli/docker_client.py", line 41, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 197, in __init__
  File "docker/api/client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[65638] Failed to execute script docker-compose

클론코딩 Next.js typescript react nodejs docker postgresql

답변 1

0

John Ahn

안녕하세요 현석오 님

지금 경로를 보면 server 디렉터리에서 명령어를 작성해주시고 있는데

프로젝트의 루트 디렉터리로 가서 cd../

다시 명령어 작성해서 시도해보시겠어요?

감사합니다.

toJson을 추가하면 [sub].tsx에서 sub를 받아오지 못합니다.

0

118

2

쿠키 저장이 되지 않습니다.

0

223

1

AxiosError {message: 'Request failed with status code 401/500', name: 'AxiosError', code: 'ERR_BAD_RESPONSE', (2)

0

580

1

AxiosError {message: 'Request failed with status code 401/500', name: 'AxiosError', code: 'ERR_BAD_RESPONSE',

0

647

1

overload 에러

0

170

1

docker compose up 오류

0

206

1

부록) remark 강의 중 parmas 오류

0

139

1

3000번은 잘 들어가지는데 80번은 안됩니다.

1

293

0

커뮤니티를 올리고 난 후 404 page

0

209

1

tailwind css 문제인지, className 에 적용한 css가 적용되지 않아요.

0

1042

2

tsx 수정 시 마다 빌드 후 서버 시작 해야하나요?

0

652

2

useState 쳤을 때 자동완성 되는 단축키 무엇인가요? extention 인가요?

0

805

2

리액트 서버 npm run dev 와 npm run build 후 npm start 의 차이

0

4596

2

data 폴더가 생성되지 않아요.

0

524

1

docker-compose up 오류

0

814

1

회원 가입 페이지 기능 생성(3) 중 에러

0

379

2

Entity에 toJSON 코드 입력 후 404 에러

0

252

1

context에서 useEffect 선언 부분 질문 있어요.

0

294

1

src 폴더구조

0

509

2

서버 실행 시 에러 관련하여 답변받고 1차 조치했는데 여전하여서 질문 남깁니다

0

298

1

엔티티 모두 작성 후 서버 실행 시 에러가 발생합니다

0

312

1

회원가입 누르면 404에러가 뜹니다 ;-;

1

421

1

nextjs버젼에 대해서 질문드립니다.

0

372

1

<npm run dev>시 -61 에러가 나타납니다!

0

357

1