Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/workflows/autoReviewers.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/autoSync-develop.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/autoSync-main.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy to Development

on:
push:
branches:
- develop

env:
DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/billilge-client
CAPROVER_APP: dev

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: development

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create .env file
run: echo "${{ secrets.DEV_ENV_FILE }}" > .env.production

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE }}:dev
${{ env.DOCKER_IMAGE }}:dev-${{ github.sha }}
cache-from: type=gha,scope=dev
cache-to: type=gha,mode=max,scope=dev

- name: Deploy to CapRover
uses: caprover/[email protected]
with:
server: ${{ secrets.CAPROVER_SERVER }}
app: ${{ env.CAPROVER_APP }}
token: ${{ secrets.CAPROVER_DEV_APP_TOKEN }}
image: ${{ env.DOCKER_IMAGE }}:dev
51 changes: 51 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to Production

on:
push:
branches:
- main

env:
DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/billilge-client
CAPROVER_APP: app

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create .env file
run: echo "${{ secrets.PROD_ENV_FILE }}" > .env.production

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE }}:prod
${{ env.DOCKER_IMAGE }}:prod-${{ github.sha }}
${{ env.DOCKER_IMAGE }}:latest
cache-from: type=gha,scope=prod
cache-to: type=gha,mode=max,scope=prod

- name: Deploy to CapRover
uses: caprover/[email protected]
with:
server: ${{ secrets.CAPROVER_SERVER }}
app: ${{ env.CAPROVER_APP }}
token: ${{ secrets.CAPROVER_PROD_APP_TOKEN }}
image: ${{ env.DOCKER_IMAGE }}:prod
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --ignore-scripts

COPY . .
RUN yarn build

# Production stage
FROM node:20-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

CMD ["node", "server.js"]
3 changes: 2 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const nextConfig = withPWA({
DB_NAME: process.env.DB_NAME,
},
reactStrictMode: true,
output: 'standalone',
swcMinify: true,
async redirects() {
return [
Expand All @@ -34,7 +35,7 @@ const nextConfig = withPWA({
images: {
domains: [
'github.com',
'billilge-resources.s3.us-west-2.amazonaws.com', // S3 이미지 도메인 추가
'minio-api.billilge.site', // 파일서버 이미지 도메인 추가
],
dangerouslyAllowSVG: true,
contentSecurityPolicy: "default-src 'self'; img-src 'self' data: https:;",
Expand Down