-
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.
Merge pull request #1 from YAPP-Github/config/monorepo
- Loading branch information
Showing
12 changed files
with
163 additions
and
16 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,45 @@ | ||
# node_modules | ||
node_modules | ||
app/**/node_modules | ||
libs/**/node_modules | ||
|
||
# build output | ||
dist | ||
app/**/dist | ||
# libs/**/dist | ||
|
||
# dependency manager | ||
.pnpm | ||
.pnp | ||
.pnp.js | ||
|
||
# git | ||
.git | ||
.gitignore | ||
*.md | ||
|
||
# local dev configs | ||
.vscode | ||
.DS_Store | ||
*.swp | ||
|
||
# logs | ||
Thumbs.db | ||
*.tmp | ||
*.log | ||
|
||
# docker | ||
Dockerfile | ||
docker-compose.yml | ||
|
||
# test & coverage reports | ||
coverage | ||
*.test.js | ||
*.spec.js | ||
*.test.ts | ||
*.spec.ts | ||
|
||
# env files | ||
.env | ||
.env.local | ||
.env.*.local |
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,9 @@ | ||
# compiled output | ||
/dist | ||
/node_modules | ||
**/dist | ||
**/node_modules | ||
**/tsconfig.tsbuildinfo | ||
|
||
# Logs | ||
logs | ||
|
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,35 @@ | ||
|
||
# Base Stage | ||
FROM node:20-slim AS base | ||
|
||
ARG PKG_NAME | ||
ARG PORT | ||
|
||
ENV PKG_NAME=$PKG_NAME | ||
ENV PORT=$PORT | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
|
||
RUN corepack enable | ||
|
||
# Builder Stage | ||
FROM base AS builder | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
|
||
# Install dependencies: with dependency cache | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
|
||
# Build shared libraries & Auth application | ||
RUN pnpm --filter "libs/*" build | ||
RUN pnpm --filter=$PKG_NAME build | ||
|
||
# Remove unnecessary dependencies from production | ||
RUN pnpm --filter=$PKG_NAME deploy --prod /prod | ||
|
||
# Prod Stage | ||
FROM base AS prod | ||
COPY --from=builder /prod /prod | ||
WORKDIR /prod | ||
EXPOSE $PORT | ||
CMD [ "node", "dist/main" ] |
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,12 @@ | ||
{ | ||
"name": "@apps/auth", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"@libs/common": "workspace:*" | ||
}, | ||
"scripts": { | ||
"start": "nest start", | ||
"build": "nest build", | ||
"test": "jest" | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"rootDir": "./src" | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules", "dist"] | ||
} |
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,15 @@ | ||
version: '3.8' | ||
|
||
services: | ||
auth: | ||
image: 'hedwig/auth' | ||
build: | ||
context: . | ||
dockerfile: ./apps/Dockerfile.app | ||
args: | ||
- PKG_NAME=@apps/auth | ||
- PORT=3000 | ||
container_name: auth | ||
ports: | ||
- '3000:3000' | ||
restart: 'no' |
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,9 @@ | ||
{ | ||
"name": "@libs/common", | ||
"version": "1.0.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc" | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "./dist", | ||
"rootDir": "./src" | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules", "dist"] | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,3 @@ | ||
packages: | ||
- 'apps/*' | ||
- 'libs/*' |
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