-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
pnpm
for package manager (#361)
* Introduce Mono Repo structure using pnpm * Add setting for pnpm installation in docker * Change `pnpm ci` to `pnpm i` & `lint-staged` location * Fix README.md about full stack development mode * Change version in root package.json * Change formatting * Remove redundant pnpm installation step * Use `pnpm install --frozen-lockfile` for CI environments * Clarify instruction in README.md * Fix instructions about package.json and version * Add generate prisma script * Fix frontend build error * Add dependency * Change off to error * Change into new pnpm-lock.yaml * Add cache "pnpm" in CI * Manage the version only in root `package.json` * Remove version pnpm * Add dockerfile * Delete ./backend/Dockerfile * Add package.json version * Add necessary setting in Dockerfile * Fix tab indentation and format script * Fix MAINTAINING.md * Fix format * Fix frontend, backend readme.md * Delete # @Format in yaml * Fix frontend readme.md * Fix Dockerfile and location of .dockerignore --------- Co-authored-by: blurfx <[email protected]>
- Loading branch information
Showing
30 changed files
with
13,893 additions
and
22,033 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -12,13 +12,14 @@ jobs: | |
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
- name: Setup Node 🔧 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
cache: "npm" | ||
cache-dependency-path: frontend/package-lock.json | ||
cache: "pnpm" | ||
cache-dependency-path: pnpm-lock.yaml | ||
|
||
- name: Setup Sentry Env 🛠️ | ||
working-directory: ${{ env.working-directory }} | ||
|
@@ -32,8 +33,8 @@ jobs: | |
env: | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
run: | | ||
npm ci | ||
npm run build | ||
pnpm install --frozen-lockfile | ||
pnpm run build | ||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
|
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,54 @@ | ||
# Stage 1: build codepair backend | ||
# Start from the node base image | ||
FROM node:alpine3.18 AS base | ||
# Set pnpm installation directory and add it to the PATH | ||
RUN corepack enable | ||
RUN corepack use pnpm@9 | ||
|
||
# Download dependency for Prisma | ||
RUN apk upgrade --update-cache --available && \ | ||
apk add openssl && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
# Download dependencies for Puppeteer | ||
RUN apk add --no-cache \ | ||
chromium \ | ||
nss \ | ||
freetype \ | ||
harfbuzz \ | ||
ca-certificates \ | ||
ttf-freefont \ | ||
wget \ | ||
unzip | ||
|
||
# Download Korean font for Puppeteer | ||
RUN mkdir /usr/share/fonts/nanumfont && \ | ||
wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip && \ | ||
unzip NanumFont_TTF_ALL.zip -d /usr/share/fonts/nanumfont && \ | ||
fc-cache -f -v | ||
|
||
# Set the environment variables | ||
ENV NODE_ENV production | ||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true | ||
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser | ||
|
||
# Stage 2: build stage | ||
FROM base AS build | ||
COPY . /usr/src/app | ||
WORKDIR /usr/src/app | ||
RUN sed -i 's/"prepare": "husky install"/"prepare": ""/' ./package.json | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm backend db:generate | ||
RUN pnpm backend build | ||
RUN pnpm deploy --filter=backend --prod /prod/backend | ||
WORKDIR /prod/backend | ||
RUN pnpx prisma generate | ||
|
||
# Stage 3: deploy stage | ||
FROM base AS backend | ||
COPY --from=build /prod/backend /prod/backend | ||
WORKDIR /prod/backend | ||
EXPOSE 3000 | ||
|
||
# Run the backend server | ||
CMD ["pnpm", "run", "start:prod"] |
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 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
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
Oops, something went wrong.