Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/docker-image-CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,19 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}

# lpilogue-be 컨테이너가 이미 실행 중인 경우 중지 및 제거
- name: Stop lpilogue-be
run: docker stop lpilogue-be || true && docker rm lpilogue-be || true
# lpilogue-rec 컨테이너가 이미 실행 중인 경우 중지 및 제거
- name: Stop lpilogue-rec
run: docker stop lpilogue-rec || true && docker rm lpilogue-rec || true
# lpilogue-db 컨테이너가 이미 실행 중인 경우 중지 및 제거
- name: Stop lpilogue-db
run: docker stop lpilogue-db || true && docker rm lpilogue-db || true
# lpilogue-fe 컨테이너가 이미 실행 중인 경우 중지 및 제거
- name: Stop lpilogue-fe
run: docker stop lpilogue-fe || true && docker rm lpilogue-fe || true

# react-app만 다시 실행
- name: Run Docker compose
run: docker compose rm -f react-app && docker compose up -d --no-deps react-app
run: docker compose rm -f react-app && docker compose up -d react-app
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ RUN npm run build
FROM nginx:1.24-alpine

# nginx.conf 파일 가져와서 template안에 넣음
#COPY nginx.conf /etc/nginx/conf.d/default.conf.template
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf.template

# 쉘 명령어들 가져오고 권한 부여
#COPY docker-entrypoint.sh /usr/local/bin/
#RUN chmod +x /usr/local/bin/docker-entrypoint.sh
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh


# 빌드 이미지에서 생성된 dist 폴더를 nginx 이미지로 복사
COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 80

#ENTRYPOINT ["docker-entrypoint.sh"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ services:
image: hadoroke/lpilogue-fe:latest
ports:
- "3000:3000"
environment:
BE_HOST: "lpilogue-be"
BE_PORT: "8080"
REC_HOST: "lpilogue-rec"
REC_PORT: "5000"
depends_on:
- spring-boot-app
- flask-app
Expand Down
9 changes: 2 additions & 7 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
server {
listen 3000;
server_name _;
resolver 127.0.0.11 valid=10s;

location / {
root /usr/share/nginx/html;
index index.html index.html;
}

location /api/be {
set $BE_HOST lpilogue-be
set $BE_PORT 8080;
proxy_pass http://$BE_HOST:$BE_PORT;
proxy_pass http://${BE_HOST}:${BE_PORT};
}
location /api/rec {
set $REC_HOST lpilogue-rec
set $REC_PORT 5000;
proxy_pass http://$REC_HOST:$REC_PORT;
proxy_pass http://${REC_HOST}:${REC_PORT};
}

error_page 500 502 503 504 /50x.html;
Expand Down