-
Notifications
You must be signed in to change notification settings - Fork 18
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 #81 from restackio/getStartedHello
Quickstart hello with endpoints
- Loading branch information
Showing
14 changed files
with
2,664 additions
and
0 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,7 @@ | ||
# Deploy on Restack Cloud | ||
|
||
RESTACK_ENGINE_ID= | ||
RESTACK_ENGINE_ADDRESS= | ||
RESTACK_ENGINE_API_KEY= | ||
|
||
RESTACK_CLOUD_TOKEN= |
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,52 @@ | ||
# Build stage | ||
FROM node:20-bullseye AS builder | ||
|
||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Copy package files and env file if it exists | ||
COPY package*.json .env* ./ | ||
|
||
# Copy package files | ||
COPY package*.json ./ | ||
|
||
# Install dependencies including TypeScript | ||
RUN pnpm install | ||
RUN pnpm add -D typescript | ||
|
||
# Copy source code | ||
COPY . . | ||
|
||
# Build TypeScript code | ||
RUN pnpm run build | ||
|
||
# Production stage | ||
FROM node:20-bullseye | ||
|
||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Copy package files and built code | ||
COPY --from=builder /app/package*.json ./ | ||
COPY --from=builder /app/dist ./dist | ||
|
||
# Install production dependencies only | ||
RUN pnpm install --prod | ||
|
||
# Define environment variables | ||
ARG RESTACK_ENGINE_ID | ||
ENV RESTACK_ENGINE_ID=${RESTACK_ENGINE_ID} | ||
|
||
ARG RESTACK_ENGINE_ADDRESS | ||
ENV RESTACK_ENGINE_ADDRESS=${RESTACK_ENGINE_ADDRESS} | ||
|
||
ARG RESTACK_ENGINE_API_KEY | ||
ENV RESTACK_ENGINE_API_KEY=${RESTACK_ENGINE_API_KEY} | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "dist/services.js"] |
Oops, something went wrong.