-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployment and dockers files for hosting Write patterns example. I did some changes to load env vars and add db ids, etc. There seems to be some problem with pattern 4, but I'm not sure if is just me. --------- Co-authored-by: James Arthur <thruflo@gmail.com> Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
- Loading branch information
1 parent
359ceed
commit e267c28
Showing
14 changed files
with
416 additions
and
116 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,33 @@ | ||
FROM node:lts-alpine AS base | ||
|
||
# Stage 1: Install dependencies | ||
FROM base AS deps | ||
WORKDIR /app | ||
|
||
RUN npm install -g pnpm | ||
|
||
COPY pnpm-*.yaml ./ | ||
COPY package.json ./ | ||
COPY tsconfig.build.json ./ | ||
COPY tsconfig.base.json ./ | ||
COPY packages/typescript-client packages/typescript-client/ | ||
COPY packages/react-hooks packages/react-hooks/ | ||
COPY packages/experimental packages/experimental/ | ||
COPY examples/write-patterns/ examples/write-patterns/ | ||
|
||
# Install dependencies | ||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm run -r build | ||
|
||
|
||
# Need to make production image more clean | ||
FROM node:lts-alpine AS prod | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
COPY --from=deps /app/ ./ | ||
|
||
WORKDIR /app/examples/write-patterns | ||
|
||
EXPOSE 3001 | ||
ENTRYPOINT ["node", "shared/backend/api.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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export const ELECTRIC_URL = | ||
import.meta.env.VITE_ELECTRIC_URL || 'http://localhost:3000' | ||
|
||
export const envParams: { database_id?: string; token?: string } = | ||
import.meta.env.VITE_ELECTRIC_TOKEN && | ||
import.meta.env.VITE_ELECTRIC_DATABASE_ID | ||
? { | ||
database_id: import.meta.env.VITE_ELECTRIC_DATABASE_ID, | ||
token: import.meta.env.VITE_ELECTRIC_TOKEN, | ||
} | ||
: {} |
Oops, something went wrong.