강의

멘토링

커뮤니티

Inflearn Community Q&A

rockbell89's profile image
rockbell89

asked

Node and React series that you can learn by following - Creating a Reddit site (NextJS) (Pages Router)

Running the Server

ubuntu 서버에서 postgres 관련 에러

Written on

·

454

0

ec2 서버에서 docker 실행하고 서버실행햇는데

DataSource Entity 관련 에러가 있네요

로컬에서는 작동이 잘 되는 것 같은데 뭐가 문제일까요?

typescriptnodejsreactpostgresqldockerNext.js클론코딩

Answer 3

0

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요

현재 보면 datasource 에는 host 가 localhost 이고 docker compose 에는 db 라고 되어잇습니다. 이 둘을 똑같이해주셔야합니다. datasource에 host룰 db 로 바꿔주세요 ~~

감사합니다.

0

rockbell89님의 프로필 이미지
rockbell89
Questioner

이부분 어떻게 바꿔줘야 하는지 궁금합니다!

0

John Ahn님의 프로필 이미지
John Ahn
Instructor

안녕하세요
혹시 host: "localhost" 이 부분 docker-compose.yml 파일에
디비를 위한 서비스 이름으로 바꿔주셨나요 ~ ?

rockbell89님의 프로필 이미지
rockbell89
Questioner

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

 

디비를 위한 서비스 이름이라하면 container_name 인가요?

rockbell89's profile image
rockbell89

asked

Ask a question