-
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 #4 from gemini-hlsw/typesafe-graphql
typesafe graphql
- Loading branch information
Showing
43 changed files
with
5,303 additions
and
707 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,10 @@ | ||
node_modules | ||
.git | ||
.gitignore | ||
*.md | ||
dist | ||
tasks | ||
.vscode | ||
.github | ||
*.svg | ||
.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
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,32 +1,42 @@ | ||
FROM node:22-alpine AS runner | ||
ENV NODE_ENV=production | ||
# Base image with Node.js and pnpm and a custom user | ||
FROM node:22-alpine AS base | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
RUN apk update \ | ||
&& apk add openssl \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/cache/apt/* | ||
RUN apk add --no-cache openssl | ||
|
||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# Installs pnpm | ||
RUN pnpm --version | ||
|
||
# Create software user | ||
RUN addgroup -S software -g 3624 && adduser -S software -u 3624 -G software | ||
RUN chown -R software:software /usr/src/app | ||
USER software | ||
|
||
# Copy dependency definitions | ||
COPY --chown=software:software package.json . | ||
COPY --chown=software:software . . | ||
|
||
# Install dependencies | ||
RUN npm install | ||
# Separate layer for dependencies, caching the npm cache | ||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile | ||
|
||
# Copy all the remaining code | ||
COPY --chown=software:software . . | ||
# Separate layer for building, caching the npm cache | ||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm build | ||
|
||
# Final image | ||
FROM base | ||
ENV NODE_ENV=production | ||
|
||
# Build | ||
RUN npm run build | ||
# Copy built files | ||
COPY --from=prod-deps --chown=software:software /usr/src/app/node_modules /usr/src/app/node_modules | ||
COPY --from=build --chown=software:software /usr/src/app/dist /usr/src/app/dist | ||
|
||
# Generate prisma definitions | ||
RUN npx prisma generate | ||
EXPOSE 4000 | ||
|
||
# Start command | ||
CMD ["./start-server.sh"] |
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.