더북(TheBook)

코드 4-1 docker-compose.yml 파일 예

version: <docker-compose-version> 
services: 
    database:
        image: <database-docker-image-name> 
        ports: 
            - "<databasePort>:<databasePort>" 
    environment: 
        POSTGRES_USER: <databaseUser>
        POSTGRES_PASSWORD: <databasePassword>
        POSTGRES_DB: <databaseName>

    <service-name>:
        image: <service-docker-image-name> 
        ports: 
            - "<applicationPort>:<applicationPort>" 
        environment: 
            PROFILE: <profile-name> 
            DATABASESERVER_PORT: "<databasePort>"
        container_name: <container_name>
            networks:
            backend:
            aliases:
                - "alias" 
networks:
    backend:
        driver: bridge
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.