Skip to content

Commit

Permalink
Merge pull request #15 from clghks/master
Browse files Browse the repository at this point in the history
[IF] Docker 설정 파일 외부 주입 #10
  • Loading branch information
clghks authored May 11, 2019
2 parents 7acc4d1 + cd77adb commit 0ea8b58
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
10 changes: 4 additions & 6 deletions APIServer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ WORKDIR /usr/src/app
RUN apt-get install -y git

RUN apt-get install build-essential
RUN npm install -g pm2

# Community-rewards 코드 받기
RUN git clone https://github.com/JAVACAFE-STUDY/community-rewards.git
WORKDIR /usr/src/app/community-rewards

RUN npm install
RUN npm install --prefix backend/
WORKDIR /usr/src/app/community-rewards/backend

# 설정 파일 복사
COPY .env backend/.env

WORKDIR /usr/src/app/community-rewards/backend
COPY .env .env

EXPOSE 3000
CMD [ "npm", "start" ]
CMD [ "npm", "run", "deploy" ]
10 changes: 4 additions & 6 deletions APIServer/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ WORKDIR /usr/src/app
RUN apt-get install -y git

RUN apt-get install build-essential
RUN npm install -g pm2

# Community-rewards 코드 받기
RUN git clone https://github.com/JAVACAFE-STUDY/community-rewards.git
WORKDIR /usr/src/app/community-rewards
RUN git checkout -t origin/develop

RUN npm install
RUN npm install --prefix backend/
WORKDIR /usr/src/app/community-rewards/backend

# 설정 파일 복사
COPY .env backend/.env

WORKDIR /usr/src/app/community-rewards/backend
COPY .env .env

EXPOSE 3000
CMD [ "npm", "start" ]
CMD [ "npm", "run", "deploy" ]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ docker build -t community-rewards/backend .
docker run -d -p 3000:3000 -v /data/profile:/data/profile community-rewards/backend
```

# API 서버 설정 파일 변경
```
docker cp .env_dev [container id]:/usr/src/app/community-rewards/backend/.env
sudo docker stop [container id]
sudo docker start [container id]
// 예제
[container id] = 9c1832636416
docker cp .env_dev 9c1832636416:/usr/src/app/community-rewards/backend/.env
sudo docker stop 9c1832636416
sudo docker start 9c1832636416
```


# Admin 서버 빌드 및 실행
### 실행 명령어
```zsh
Expand Down

0 comments on commit 0ea8b58

Please sign in to comment.