-
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.
+ Add `Dockerfile.production`
- Loading branch information
Showing
30 changed files
with
1,442 additions
and
1,594 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
./yarn |
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,6 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"arcanis.vscode-zipfs", | ||
"dbaeumer.vscode-eslint" | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode" | ||
] | ||
} |
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
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
#!/usr/bin/env node | ||
|
||
const {existsSync} = require(`fs`); | ||
const {createRequire} = require(`module`); | ||
const {resolve} = require(`path`); | ||
|
||
const relPnpApiPath = "../../../../.pnp.cjs"; | ||
|
||
const absPnpApiPath = resolve(__dirname, relPnpApiPath); | ||
const absRequire = createRequire(absPnpApiPath); | ||
|
||
if (existsSync(absPnpApiPath)) { | ||
if (!process.versions.pnp) { | ||
// Setup the environment to be able to require eslint/use-at-your-own-risk | ||
require(absPnpApiPath).setup(); | ||
} | ||
} | ||
|
||
// Defer to the real eslint/use-at-your-own-risk your application uses | ||
module.exports = absRequire(`eslint/use-at-your-own-risk`); |
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,6 +1,14 @@ | ||
{ | ||
"name": "eslint", | ||
"version": "8.45.0-sdk", | ||
"version": "8.52.0-sdk", | ||
"main": "./lib/api.js", | ||
"type": "commonjs" | ||
"type": "commonjs", | ||
"bin": { | ||
"eslint": "./bin/eslint.js" | ||
}, | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": "./lib/api.js", | ||
"./use-at-your-own-risk": "./lib/unsupported-api.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,20 @@ | ||
#!/usr/bin/env node | ||
|
||
const {existsSync} = require(`fs`); | ||
const {createRequire} = require(`module`); | ||
const {resolve} = require(`path`); | ||
|
||
const relPnpApiPath = "../../../../.pnp.cjs"; | ||
|
||
const absPnpApiPath = resolve(__dirname, relPnpApiPath); | ||
const absRequire = createRequire(absPnpApiPath); | ||
|
||
if (existsSync(absPnpApiPath)) { | ||
if (!process.versions.pnp) { | ||
// Setup the environment to be able to require prettier/bin/prettier.cjs | ||
require(absPnpApiPath).setup(); | ||
} | ||
} | ||
|
||
// Defer to the real prettier/bin/prettier.cjs your application uses | ||
module.exports = absRequire(`prettier/bin/prettier.cjs`); |
0
.yarn/sdks/prettier/index.js → .yarn/sdks/prettier/index.cjs
100755 → 100644
File renamed without changes.
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,6 +1,7 @@ | ||
{ | ||
"name": "prettier", | ||
"version": "3.0.0-sdk", | ||
"main": "./index.js", | ||
"type": "commonjs" | ||
"main": "./index.cjs", | ||
"type": "commonjs", | ||
"bin": "./bin/prettier.cjs" | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
FROM node:18 | ||
WORKDIR /app | ||
COPY package.json yarn.lock ./*.yml ./*.yaml ./*.config.js ./*.json ./ | ||
COPY ./.yarn/releases ./.yarn/releases | ||
RUN yarn | ||
COPY ./src ./src | ||
COPY ./public ./public | ||
CMD ["yarn", "run", "dev"] |
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,50 @@ | ||
FROM node:21-alpine AS base | ||
|
||
# Install dependencies only when needed | ||
FROM base AS deps | ||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
RUN apk add --no-cache libc6-compat git | ||
WORKDIR /app | ||
|
||
# Install dependencies based on the preferred package manager | ||
COPY package.json yarn.lock* ./ | ||
RUN \ | ||
corepack enable && \ | ||
yarn set version from sources && \ | ||
yarn install | ||
|
||
# Rebuild the source code only when needed | ||
FROM base AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/.yarn ./.yarn | ||
COPY . . | ||
RUN yarn build | ||
|
||
# Production image, copy all the files and run next | ||
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 | ||
|
||
# Set the correct permission for prerender cache | ||
RUN mkdir .next | ||
RUN chown nextjs:nodejs .next | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
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"] |
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,10 @@ | ||
services: | ||
nextjs: | ||
ports: | ||
- 80:3000 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ./src:/app/src:ro | ||
- ./public:/app/public:ro |
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
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,4 +1,13 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
const nextConfig = { | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: 'cdn.gifthub.kr', | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
import { http } from './http'; | ||
|
||
export interface GetGiftcard { | ||
senderProfile: string; | ||
senderName: string; | ||
message: string; | ||
productImage: string; | ||
productName: string; | ||
brandImage: string; | ||
brandName: string; | ||
expirationDate: string; | ||
} | ||
|
||
async function getGiftcard( | ||
uuid: string, | ||
password: string, | ||
): Promise<GetGiftcard> { | ||
try { | ||
const response = await http.get(`/giftcards/${uuid}`, { | ||
headers: { | ||
Authorization: `Basic ${atob(password)}`, | ||
}, | ||
}); | ||
return await response.json(); | ||
} catch { | ||
return { | ||
senderProfile: '/dahyeon.jpeg', | ||
senderName: uuid, | ||
message: password, | ||
productImage: '/dahyeon.jpeg', | ||
productName: '아이스 카페 아메리카노 T', | ||
brandImage: '/dahyeon.jpeg', | ||
brandName: '스타벅스', | ||
expirationDate: '2023-07-25', | ||
}; | ||
} | ||
} | ||
|
||
const GiftcardApi = { | ||
getGiftcard, | ||
}; | ||
|
||
export default GiftcardApi; |
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,26 @@ | ||
import returnFetch from 'return-fetch'; | ||
|
||
const instance = returnFetch({ | ||
baseUrl: 'https://api.dev.gifthub.kr', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}); | ||
|
||
const http = { | ||
get: function (url: string, options?: RequestInit) { | ||
return instance(url, { | ||
method: 'GET', | ||
...options, | ||
}); | ||
}, | ||
post: function (url: string, options?: RequestInit) { | ||
return instance(url, { | ||
method: 'POST', | ||
...options, | ||
}); | ||
}, | ||
}; | ||
|
||
export { http }; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.