-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
42 lines (30 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Node.js image for building the server
FROM node:18-alpine AS builder
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the entire source code into the working directory
COPY . .
# Build the TypeScript files
RUN npm run build
# Use a smaller Node.js image for the runtime
FROM node:18-slim
# Set the working directory in the runtime image
WORKDIR /app
# Copy the build files from the builder image
COPY --from=builder /app/build ./build
# Copy package.json and package-lock.json for production install
COPY package.json package-lock.json ./
# Install only production dependencies
RUN npm install --omit=dev
# Set environment variables for Twitter API
ENV API_KEY=your_api_key_here
ENV API_SECRET_KEY=your_api_secret_key_here
ENV ACCESS_TOKEN=your_access_token_here
ENV ACCESS_TOKEN_SECRET=your_access_token_secret_here
# Start the server
CMD ["node", "build/index.js"]