• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

도커 배포시에 image upload 경로 설정

20.12.05 13:51 작성 조회수 140

0

안녕하세요 선생님.

좋은 강의 올려주셔서 많이 배울 수 있었습니다.

이제 이 프로젝트를 도커로 만들어서 배포 해보고 싶어서,

docker-compose up을 구글링으로 해보고 있습니다.

client와 server를 따로 dockerfile을 만든 후에, compose-up으로 같이 실행하는거까지는 이해가 가는데,

그 후에 upload 디렉토리와 경로를 어떻게 설정해야 할지 모르겠어서 질문남깁니다.

먼저 docker-compose.yaml 파일의 코드는 이렇습니다.

version: "3"
services:
  client:                 
    build:
      dockerfile: dockerfile
      context: ./client    
    volumes:
      - ./client/:/app      
      - /app/node_modules  
    networks:
      - backend           
  server:                          
    build:
      dockerfile: dockerfile
      context: ./server    
    volumes:
      - ./server/:/app      
      - /app/node_modules      
    environment:
      - NODE_PATH=src
      - PORT=5000
      - NODE_ENV="production" #안되면 이거 그냥 제거하고 dev모두로 사용
      - MONGO_URI='mongodb+srv://<name>:<password>@boilerflate.ynaxn.mongodb.net/<db>?retryWrites=true&w=majority'   
    networks:
      - backend  
    ports:
      - "5000:5000"   

  nginx:
    restart: always
    build:
      dockerfile: dockerfile
      context: ./nginx 
    ports:
      - '3000:80' 
    networks:
      - backend
    
networks: 
  backend:
    driver: bridge

volumes:
  data:
    driver: local  
제가 Node.js와 배포가 처음이라, Nodejs 환경변수 설정하는게 저게 맞는지도 헷갈립니다..
ㅠㅠ

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!