Skip to content

Commit

Permalink
setting(#368) nginx-conf
Browse files Browse the repository at this point in the history
  • Loading branch information
2swo committed Mar 19, 2024
1 parent bd4f1af commit 5bb6f0c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
54 changes: 27 additions & 27 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Node.js 버전을 기반으로 하는 도커 이미지 사용
FROM node:18.16.0-alpine AS build
# # Node.js 버전을 기반으로 하는 도커 이미지 사용
# FROM node:18.16.0-alpine AS build

# 작업 디렉토리 설정
WORKDIR /home/app
# # 작업 디렉토리 설정
# WORKDIR /home/app

# 작업 디렉토리에 내용 복사
COPY package*.json ./
# # 작업 디렉토리에 내용 복사
# COPY package*.json ./

RUN npm ci --only=production && npm cache clean --force
# RUN npm ci --only=production && npm cache clean --force

# /dist 폴더를 이미지에 복사
COPY ./dist ./dist
# # /dist 폴더를 이미지에 복사
# COPY ./dist ./dist

# 애플리케이션 실행
CMD ["npm", "run", "start:prod"]
# # 애플리케이션 실행
# CMD ["npm", "run", "start:prod"]

# 애플리케이션을 실행할 포트
EXPOSE 3000
# # 애플리케이션을 실행할 포트
# EXPOSE 3000

######################### Redis ##############################

Expand All @@ -40,22 +40,22 @@ EXPOSE 3000

######################### nginx-certbot ##############################

# #nginx 이미지 사용
# FROM nginx:latest
#nginx 이미지 사용
FROM nginx:latest

# #nignx와 certbot 설치
# RUN apt-get update && apt-get install -y certbot python3-certbot-nginx
#nignx와 certbot 설치
RUN apt-get update && apt-get install -y certbot python3-certbot-nginx

# #nginx.conf(설정파일 복사)
# COPY nginx.conf /etc/nginx/nginx.conf
#nginx.conf(설정파일 복사)
COPY nginx.conf /etc/nginx/nginx.conf

# #port
# EXPOSE 80
# EXPOSE 443
#port
EXPOSE 80
EXPOSE 443

# #entrypoint.sh 복사, 권한부여
# COPY entrypoint.sh /entrypoint.sh
# RUN chmod +x /entrypoint.sh
#entrypoint.sh 복사, 권한부여
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# #컨테이너가 실행될 때 entrypoint.sh 실행
# CMD ["/entrypoint.sh"]
#컨테이너가 실행될 때 entrypoint.sh 실행
CMD ["/entrypoint.sh"]
9 changes: 6 additions & 3 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ events {
http {
server {
listen 80;
server_name api.menbosha.kr; # back은 api만 사용
# server_name api.menbosha.kr; # 베포백서버
server_name dev.menbosha.kr; # 개발백서버
location / {
proxy_pass http://13.124.22.25:3000;
# proxy_pass http://13.124.22.25:3000; # 베포백서버 ipv4
proxy_pass http://15.164.222.126:3000; # 개발백서버 ipv4
}
location /socket.io/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://13.124.22.25:3000;
# proxy_pass http://13.124.22.25:3000; # 베포백서버 ipv4
proxy_pass http://15.164.222.126:3000; # 개발백서버 ipv4
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Expand Down

0 comments on commit 5bb6f0c

Please sign in to comment.