-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add Dockerfiles and build pipeline
- Loading branch information
1 parent
9c9287f
commit 439029b
Showing
5 changed files
with
130 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
ARG NODE_VERSION=20.11.1 | ||
|
||
FROM node:${NODE_VERSION}-slim AS base | ||
WORKDIR /app | ||
|
||
FROM base AS build | ||
WORKDIR /build | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 | ||
|
||
COPY --link ./ /build/ | ||
|
||
RUN npm ci | ||
|
||
ARG NEXT_PUBLIC_INFERABLE_API_URL | ||
ENV NEXT_PUBLIC_INFERABLE_API_URL=$NEXT_PUBLIC_INFERABLE_API_URL | ||
|
||
ARG NEXT_PUBLIC_APP_URL | ||
ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL | ||
|
||
ARG NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | ||
ENV NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=$NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | ||
|
||
ARG NEXT_PUBLIC_HYPERDX_API_KEY | ||
ENV NEXT_PUBLIC_HYPERDX_API_KEY=$NEXT_PUBLIC_HYPERDX_API_KEY | ||
|
||
ARG NEXT_PUBLIC_POSTHOG_KEY | ||
ENV NEXT_PUBLIC_POSTHOG_KEY=$NEXT_PUBLIC_POSTHOG_KEY | ||
ENV NEXT_PUBLIC_POSTHOG_HOST="https://www.inferable.ai/ingest" | ||
|
||
RUN npm run build | ||
RUN npm prune --omit=dev | ||
|
||
FROM base AS run | ||
|
||
# Install curl for healthchecks | ||
RUN apt-get update -qq && \ | ||
apt-get install -y curl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ARG VERSION | ||
ENV VERSION=$VERSION | ||
|
||
ARG SHORT_VERSION | ||
ENV SHORT_VERSION=$SHORT_VERSION | ||
|
||
COPY --from=build /build/ /app | ||
|
||
ENV NODE_ENV=production | ||
|
||
EXPOSE 3001 | ||
CMD [ "node", "server.js" ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# syntax = docker/dockerfile:1 | ||
|
||
ARG NODE_VERSION=20.11.1 | ||
|
||
FROM node:${NODE_VERSION}-slim AS base | ||
WORKDIR /app | ||
|
||
FROM base AS build | ||
WORKDIR /build | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 | ||
|
||
COPY --link ./ /build | ||
|
||
RUN npm ci | ||
|
||
RUN npm run build | ||
RUN npm prune --omit=dev | ||
|
||
FROM base AS run | ||
|
||
# Install curl for healthchecks | ||
RUN apt-get update -qq && \ | ||
apt-get install -y curl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ARG VERSION | ||
ENV VERSION=$VERSION | ||
|
||
ARG SHORT_VERSION | ||
ENV SHORT_VERSION=$SHORT_VERSION | ||
|
||
COPY --from=build /build/ /app | ||
|
||
ENV NODE_ENV=production | ||
|
||
EXPOSE 4000 | ||
CMD [ "npm", "run", "start" ] |
This file was deleted.
Oops, something went wrong.