-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve dockerfile, refactor turbo tasks
- Loading branch information
Showing
11 changed files
with
57 additions
and
38 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"buildCommand": "PLATFORM=vercel npx turbo build", | ||
"buildCommand": "PLATFORM=vercel npx turbo build:storybook", | ||
"outputDirectory": "storybook-static", | ||
"ignoreCommand": "npx turbo-ignore || ../../skip-dependabot.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,49 @@ | ||
# Use the official Node.js 20 image as the base | ||
FROM node:20 | ||
WORKDIR /app | ||
# Should be invoked from monorepo's root. | ||
|
||
# Copy the entire monorepo to the working directory | ||
# Use the official Node.js 20 image as the base | ||
ARG DOCKER_NODE_VERSION=20-bookworm-slim | ||
|
||
FROM node:$DOCKER_NODE_VERSION AS node-with-openssl | ||
|
||
# Install OpenSSL - necessary for Prisma client | ||
# Mount caches via https://stackoverflow.com/a/72851168 | ||
RUN --mount=type=cache,id=apt-lists,target=/var/lib/apt/lists,sharing=locked \ | ||
--mount=type=cache,id=apt-cache,target=/var/cache/apt,sharing=locked \ | ||
rm -f /etc/apt/apt.conf.d/docker-clean \ | ||
&& apt-get update \ | ||
&& apt-get install -y \ | ||
openssl | ||
# If we ever need canvas for components, uncomment these: | ||
# build-essential \ | ||
# libcairo2-dev \ | ||
# libpango1.0-dev \ | ||
# libjpeg-dev \ | ||
# libgif-dev \ | ||
# librsvg2-dev | ||
|
||
# Build | ||
FROM node-with-openssl AS build-stage | ||
WORKDIR /build | ||
|
||
RUN apt-get update && apt-get install -y apt | ||
# Install necessary dependencies for canvas | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
libcairo2-dev \ | ||
libpango1.0-dev \ | ||
libjpeg-dev \ | ||
libgif-dev \ | ||
librsvg2-dev | ||
# Install pnpm and turbo globally | ||
RUN npm install -g pnpm | ||
|
||
# Copy the entire monorepo to the working directory | ||
COPY . . | ||
# Install pnpm and turbo globally | ||
RUN npm install -g pnpm turbo | ||
|
||
# Install monorepo dependencies | ||
RUN pnpm install | ||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store/v3 pnpm install --frozen-lockfile | ||
|
||
# run turbo build | ||
WORKDIR /build/packages/hub | ||
ENV NODE_ENV=production | ||
|
||
# WORKDIR /app/packages/hub | ||
# TODO - turbo cache, either as volume or remote | ||
RUN npx turbo run bundle --concurrency=1 | ||
|
||
# RUN pnpm install | ||
FROM node-with-openssl AS run-stage | ||
WORKDIR /app | ||
|
||
# Expose the port on which the application will run (adjust if necessary) | ||
# EXPOSE 3001 | ||
COPY --from=build-stage /build/packages/hub/dist /app/dist | ||
COPY --from=build-stage /build/node_modules/.pnpm/@prisma+client*/node_modules/.prisma/client/*.so.node /app/dist | ||
|
||
# Set the command to run the application | ||
# CMD ["pnpm", "run", "build-last-revision"] | ||
CMD ["node", "dist/bundle/buildRecentModelRevision.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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"buildCommand": "PLATFORM=vercel npx turbo build", | ||
"buildCommand": "PLATFORM=vercel npx turbo build:storybook", | ||
"outputDirectory": "storybook-static", | ||
"ignoreCommand": "npx turbo-ignore || ../../skip-dependabot.sh" | ||
} |
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