반응형
postgres의 기본 포트는 5432이다.
5432포트가 55432포트로 포팅된다.
docker-compose.yml
version: '3.3' services: postgres-db: image: postgres:14.1 container_name: postgres ports: - "55432:5432" volumes: - ./data/postgresql:/var/lib/postgresql/data restart: always environment: POSTGRES_USER: user_id POSTGRES_PASSWORD: user_password POSTGRES_DB: user_db healthcheck: test: ["CMD", "pg_isready", "-U", "Dev"] networks: - net-postgres networks: net-postgres: |
docker-compose up -d 명령어를 통해서 postgresql 실행하면 됨.
반응형
'IT' 카테고리의 다른 글
ERROR: for docker_echo_1 An HTTP request took too long to complete. Retry with --verbose to obtain debug information. (0) | 2022.11.25 |
---|---|
jenkins docker-compose.yml 파일 (0) | 2022.11.24 |
docker 이미지 tar file 로드 (0) | 2022.11.23 |
Spring boot Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. (0) | 2022.11.23 |
docker 디렉토리 변경하는 방법 (0) | 2022.11.23 |