Skip to content

Commit

Permalink
chore: [FOLIO-3] 아파치 웹서버 리버스 프록시 설정을 위한 Dockerfile 및 워크플로우 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
YerangPark committed Aug 27, 2024
1 parent df5a641 commit 959b9fb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/frontend-folio:latest
docker stop frontend-folio || true
docker rm frontend-folio || true
docker run -d -p 80:80 --name frontend-folio ${{ secrets.DOCKERHUB_USERNAME }}/frontend-folio:latest
docker run -d -p 3000:3000 --name frontend-folio ${{ secrets.DOCKERHUB_USERNAME }}/frontend-folio:latest
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Node.js의 경량 버전을 베이스 이미지로 사용합니다.
# 운용할 배포 서버(랴즈)가 aarch64 플랫폼, Node.js의 경량 버전을 베이스 이미지로 사용합니다.
FROM node:20-alpine

# Apache와 필요한 패키지 설치
RUN apk --no-cache add apache2

# 앱 디렉토리를 생성하고, 작업 디렉토리로 설정합니다.
WORKDIR /app

# package.json과 package-lock.json을 복사합니다.
COPY package.json package-lock.json ./

# 의존성을 설치합니다.
# 의존성을 설치합니다. --legacy-peer-deps 옵션은 필요시 사용할 수 있습니다.
RUN npm install --legacy-peer-deps

# 소스 코드를 모두 복사합니다.
Expand All @@ -19,15 +16,8 @@ COPY . .
# 빌드를 수행합니다.
RUN npm run build

# 빌드된 정적 파일을 Apache의 서브 디렉토리로 복사합니다.
RUN cp -r .next/* /var/www/html/

# Apache를 시작할 때 사용할 스크립트를 설정합니다.
COPY start-apache /usr/local/bin/start-apache
RUN chmod +x /usr/local/bin/start-apache

# 애플리케이션 포트를 노출합니다.
EXPOSE 80
EXPOSE 3000

# Apache를 시작하는 명령어입니다.
CMD ["start-apache"]
# 앱을 시작하는 명령어입니다.
CMD ["npm", "start"]
17 changes: 17 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: 'export',

// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
// trailingSlash: true,

// Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
// skipTrailingSlashRedirect: true,

// Optional: Change the output directory `out` -> `dist`
// distDir: 'dist',
}

module.exports = nextConfig
4 changes: 0 additions & 4 deletions next.config.mjs

This file was deleted.

0 comments on commit 959b9fb

Please sign in to comment.