Skip to content

Commit

Permalink
ADD 서비스 배포 설정 (#274)
Browse files Browse the repository at this point in the history
* 🚀 #273 - 배포 관련 파일 추가 및 수정

* 💄 #273 - 사용자 기기 별 선호 색상에 따른 설정값 흰색으로 통일

* 🍱 #273 - favicon add icon으로 변경

* 🔧 #273 - prettier eol 규칙 추가

* 🩹 #273 - 파일 마지막 라인 추가
  • Loading branch information
yws1502 authored Jan 14, 2025
1 parent ca1d832 commit 8aa8ebb
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dockerfile
.github
.next
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env*

# vercel
.vercel
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"tabWidth": 2,
"trailingComma": "all",
"arrowParens": "always",
"printWidth": 80
"printWidth": 80,
"endOfLine": "lf"
}
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.5'

services:
add-fe:
container_name: add-fe
image: woosang0430/add-fe
env_file:
- ./.env
ports:
- 80:3000
restart: always
36 changes: 36 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM node:18-alpine AS base

FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app

COPY package.json yarn.lock* ./
RUN yarn --frozen-lockfile

FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

RUN yarn run build

FROM base 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"]
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const nextConfig = {
});
return config;
},
output: 'standalone',
};

module.exports = nextConfig;
Binary file modified public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions src/components/layouts/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ export default Layout;

const Main = styled.main<{ showNavbar: boolean }>`
${({ showNavbar }) => showNavbar && 'margin-bottom: 63px;'};
background-color: #fff; // FIXME: theme 설정 시 수정 예정입니다.
`;
4 changes: 2 additions & 2 deletions src/styles/GlobalStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ const GlobalStyle = css`
-webkit-appearance: none;
}
@media (prefers-color-scheme: dark) {
/* @media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
} */
`;

export default GlobalStyle;

0 comments on commit 8aa8ebb

Please sign in to comment.