forked from codemod-com/codemod
-
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.
[Backend] Codemod table, Prisma integration, Dockerfile tweaks, seedi…
…ng script (CDMD-2634, CDMD-2637, CDMD-2693) (codemod-com#109)
- Loading branch information
Showing
30 changed files
with
1,544 additions
and
7,585 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 |
---|---|---|
|
@@ -31,4 +31,4 @@ yarn-debug.log* | |
.vercel | ||
|
||
# Backend | ||
build-ncc | ||
build |
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,4 @@ | ||
node_modules | ||
prisma/generated | ||
# Keep environment variables out of version control | ||
.env |
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,26 +1,27 @@ | ||
# stage0 | ||
FROM node:19-alpine3.16 as stage0 | ||
FROM node:19-alpine3.16 | ||
|
||
WORKDIR /opt/studio-backend | ||
WORKDIR /app/ | ||
|
||
RUN npm install -g pnpm | ||
|
||
COPY ./package.json ./pnpm-lock.yaml /opt/studio-backend/ | ||
COPY ./apps/studio-backend/package.json ./apps/studio-backend/pnpm-lock.yaml /app/apps/studio-backend/ | ||
COPY ./pnpm-workspace.yaml /app/ | ||
COPY ./packages /app/packages/ | ||
|
||
RUN pnpm install | ||
|
||
COPY ./tsconfig.json /opt/studio-backend/ | ||
COPY ./src /opt/studio-backend/src | ||
COPY ./apps/studio-backend/prisma /app/apps/studio-backend/prisma/ | ||
COPY ./apps/studio-backend/.env /app/apps/studio-backend/ | ||
COPY ./apps/studio-backend/tsconfig.json /app/apps/studio-backend/ | ||
COPY ./apps/studio-backend/esbuild.config.js /app/apps/studio-backend/ | ||
COPY ./apps/studio-backend/src /app/apps/studio-backend/src/ | ||
|
||
RUN pnpm run build:ncc | ||
WORKDIR /app/apps/studio-backend | ||
|
||
# stage 1 | ||
FROM node:19-alpine3.16 as stage1 | ||
RUN pnpm db:generate | ||
|
||
WORKDIR /opt/studio-backend | ||
|
||
COPY --from=stage0 /opt/studio-backend/build-ncc/ /opt/studio-backend | ||
RUN pnpm build | ||
|
||
EXPOSE 8081 | ||
|
||
CMD ["node", "./index.js"] | ||
CMD ["node", "./build/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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
FROM node:19-alpine3.16 | ||
|
||
WORKDIR /opt/studio-backend | ||
WORKDIR /app/ | ||
|
||
RUN npm install -g pnpm | ||
|
||
COPY ./package.json ./pnpm-lock.yaml /opt/studio-backend/ | ||
COPY ./apps/studio-backend/package.json ./apps/studio-backend/pnpm-lock.yaml /app/apps/studio-backend/ | ||
COPY ./pnpm-workspace.yaml /app/ | ||
COPY ./packages /app/packages/ | ||
|
||
RUN pnpm install | ||
|
||
COPY ./tsconfig.json /opt/studio-backend/ | ||
COPY ./src /opt/studio-backend/src | ||
COPY ./apps/studio-backend/prisma /app/apps/studio-backend/prisma/ | ||
COPY ./apps/studio-backend/tsconfig.json /app/apps/studio-backend/ | ||
COPY ./apps/studio-backend/src /app/apps/studio-backend/src/ | ||
|
||
# WORKDIR /app/studio-backend | ||
|
||
CMD pnpm --filter studio-backend watch |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import esbuild from "esbuild"; | ||
|
||
esbuild | ||
.build({ | ||
entryPoints: ["src/server.ts"], | ||
bundle: true, | ||
minify: true, | ||
platform: "node", | ||
outfile: "build/server.js", | ||
external: ["@prisma/client", "pg-hstore"], | ||
banner: { | ||
js: `import { createRequire } from 'module';\nconst require = createRequire(import.meta.url);`, | ||
}, | ||
format: "esm", | ||
}) | ||
.catch(() => process.exit(1)); |
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.