Skip to content

Commit 42d1fa6

Browse files
committed
Add Dockerfile
1 parent 96ecc6d commit 42d1fa6

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
2+
# Stage 1: Build the TypeScript project
3+
FROM node:18-alpine AS builder
4+
5+
# Set working directory
6+
WORKDIR /app
7+
8+
# Copy package files and install dependencies
9+
COPY package.json package-lock.json ./
10+
RUN npm install
11+
12+
# Copy source files
13+
COPY src ./src
14+
COPY tsconfig.json ./
15+
16+
# Build the project
17+
RUN npm run build
18+
19+
# Stage 2: Set up the runtime environment
20+
FROM node:18-alpine
21+
22+
# Set working directory
23+
WORKDIR /app
24+
25+
# Copy only the necessary files from the build stage
26+
COPY --from=builder /app/dist ./dist
27+
COPY package.json package-lock.json ./
28+
29+
# Install production dependencies only
30+
RUN npm ci --omit=dev
31+
32+
# Expose any necessary ports (example: 3000)
33+
EXPOSE 3000
34+
35+
# Set the environment variable for the Apify token
36+
ENV APIFY_TOKEN=<your-apify-token>
37+
38+
# Set the entry point for the container
39+
ENTRYPOINT ["node", "dist/main.js"]

0 commit comments

Comments
 (0)