forked from 9oormthonUniv-seoultech/PROJECT_TEAM_WEB_FE2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 9oormthonUniv-seoultech#41 from 9oormthonUniv-seou…
…ltech/develop 1차 배포
- Loading branch information
Showing
143 changed files
with
5,877 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Base image for building | ||
FROM node:18-alpine AS base | ||
|
||
# Define arguments for environment variables | ||
ARG VITE_KAKAO_MAP_KEY | ||
ARG VITE_KAKAO_REST_API_KEY | ||
|
||
# Install dependencies | ||
WORKDIR /app | ||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ | ||
RUN \ | ||
if [ -f yarn.lock ]; then yarn install --frozen-lockfile; \ | ||
elif [ -f package-lock.json ]; then npm ci; \ | ||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm install --frozen-lockfile; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
# Copy source code and set environment variables | ||
COPY . . | ||
ENV VITE_KAKAO_MAP_KEY=${VITE_KAKAO_MAP_KEY} | ||
ENV VITE_KAKAO_REST_API_KEY=${VITE_KAKAO_REST_API_KEY} | ||
|
||
# Build the Vite application | ||
RUN \ | ||
if [ -f yarn.lock ]; then yarn build; \ | ||
elif [ -f package-lock.json ]; then npm run build; \ | ||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ | ||
else echo "Lockfile not found." && exit 1; \ | ||
fi | ||
|
||
# Nginx server to serve static files | ||
FROM nginx:stable-alpine AS runner | ||
|
||
# Copy built files to Nginx for serving | ||
COPY --from=base /app/dist /usr/share/nginx/html | ||
|
||
# Expose port 80 for Nginx | ||
EXPOSE 80 | ||
|
||
# Start Nginx | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
server { | ||
listen 80; | ||
server_name pocket4cut.link; | ||
|
||
# 정적 파일 서빙 | ||
location / { | ||
try_files $uri /index.html; | ||
} | ||
|
||
# API 및 SSR 요청 프록시 - 기본 요청을 애플리케이션 서버로 프록시 | ||
location / { | ||
proxy_pass http://localhost:3000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
} |
Oops, something went wrong.