-
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.
- Loading branch information
Showing
3 changed files
with
29 additions
and
16 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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
FROM node:lts-alpine | ||
WORKDIR /usr/app | ||
# 베이스 이미지 설정 | ||
FROM node:14 | ||
|
||
# Copy the package.json and package-lock.json files | ||
COPY package*.json ./ | ||
# 작업 디렉토리 생성 | ||
WORKDIR /app | ||
|
||
# Install any needed packages | ||
# 의존성 파일을 복사하고 설치 | ||
COPY package*.json ./ | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
# 애플리케이션 소스 복사 | ||
COPY . . | ||
|
||
# Expose the port the app runs on | ||
# Nginx 설치 및 설정 복사 | ||
RUN apt-get update && apt-get install -y nginx | ||
COPY nginx.conf /etc/nginx/conf.d/ | ||
|
||
# 포트 설정 | ||
EXPOSE 3000 | ||
|
||
# Run the app | ||
CMD [ "node", "src/index.js" ] | ||
# Nginx와 Node.js 서버를 모두 실행 | ||
CMD ["sh", "-c", "service nginx start && node src/index.js"] |
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,15 @@ | ||
server { | ||
listen 80; | ||
server_name worry-is-bubble.com; | ||
|
||
location /api { | ||
proxy_pass http://localhost:3000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_http_version 1.1; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
} |
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