Skip to content

Commit

Permalink
Merge pull request #81 from restackio/getStartedHello
Browse files Browse the repository at this point in the history
Quickstart hello with endpoints
  • Loading branch information
aboutphilippe authored Jan 6, 2025
2 parents 4b8ec99 + 4632a63 commit 5008936
Show file tree
Hide file tree
Showing 14 changed files with 2,664 additions and 0 deletions.
7 changes: 7 additions & 0 deletions quickstart/.env.example
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=
52 changes: 52 additions & 0 deletions quickstart/Dockerfile
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"]
Loading

0 comments on commit 5008936

Please sign in to comment.