Skip to content

[FE] fe 쪽 라우터 이슈를 해결하기 위해 동적 라우팅용 서버 코드 추가#157

Open
choesw wants to merge 2 commits intomainfrom
be-feat/fe-serve
Open

[FE] fe 쪽 라우터 이슈를 해결하기 위해 동적 라우팅용 서버 코드 추가#157
choesw wants to merge 2 commits intomainfrom
be-feat/fe-serve

Conversation

@choesw
Copy link
Copy Markdown
Contributor

@choesw choesw commented Apr 27, 2024

  • vite-express 로 serving 하고 docker 이미지로 빌드하기 위한 설정 추가
  • 틀만 만들어 두었고, FE 두 분께 정리를 부탁드리겠습니다.

@choesw choesw requested a review from MeganMagic as a code owner April 27, 2024 06:50
const port = 3001;

ViteExpress.config({
mode: "production",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • production : dist 폴더에 있는 정적 파일을 serving
  • development : src 폴더에 있는 파일을 serving

COPY ./dist ./dist
COPY ./package.json .
COPY ./package-lock.json .
COPY ./server.js .
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker image 빌드 시에는 사실상 dist 폴더와 server.js, 그리고 package.json 의 type: module 정보만 필요하긴 합니다만, package.json 또 다 찢어놓기도 뭐해서 일단 package.json 전체를 다 가져오도록 설정해뒀습니다.

@@ -0,0 +1,12 @@
FROM node:20
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

노드 버전 몇을 쓰시는지를 몰라서 일단 20으로 설정해뒀습니다.

@choesw
Copy link
Copy Markdown
Contributor Author

choesw commented Apr 27, 2024

요 PR은 확인만 하시라도 올려두는 PR 입니다. 확인하시고 Close 하셔도 됩니다.

@choesw choesw requested a review from Jeong-hae-rim April 27, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant