All Articles

psql의 λΉ„λ°€λ²ˆν˜Έ

docker-compose μ—μ„œ postgreSQL 을 μ‚¬μš©ν•  λ•Œ, ν™˜κ²½λ³€μˆ˜λ‘œ λΉ„λ°€λ²ˆν˜Έλ₯Ό λ„£κ²Œ λ˜μ–΄μžˆλ‹€.

version: '3.1'

services:

  db:
    image: postgres
    restart: always
    volumes:
      - 'postgres:/var/lib/postgresql/data'
    environment:
      POSTGRES_PASSWORD: example
    ports:
      - "5432:5432"

volumes:
    postgres:

그런데 docker-compose.yml μ—μ„œ λΉ„λ°€λ²ˆν˜Έλ₯Ό λ°”κΎΈκ³  λ‹€μ‹œ λ„μ›Œλ„ postgres μ—μ„œ λΉ„λ°€λ²ˆν˜Έκ°€ λ°”λ€Œμ§€ μ•ŠλŠ”λ‹€. μ¨λ†“κ³ λ³΄λ‹ˆκΉŒ λ‹Ήμ—°ν•œλ°, μ»¨ν…Œμ΄λ„ˆκ°€ μ‹œμž‘λ  λ•Œλ§Œ ν™˜κ²½λ³€μˆ˜μ—μ„œ λΉ„λ°€λ²ˆν˜Έλ₯Ό μ½λŠ”κ±°μ§€ κ·Έ μ΄ν›„μ—λŠ” λ‚΄λΆ€μ μœΌλ‘œ volume 에 μ €μž₯λœλ‹€.
μ§„μ§œ 써놓고 λ³΄λ‹ˆκΉŒ λ‹Ήμ—°ν•˜λ„€ γ…œγ…œλ” μžμ„Έν•œ λ‚΄μš©μ€ μ—¬κΈ°μ„œ

Published Apr 16, 2018

If I keep marking the dots, someday they will πŸ”—πŸ”—