-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (28 loc) · 1.12 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
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use an official Node.js runtime as the base image
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json for installing dependencies
COPY package.json package-lock.json ./
# Install dependencies (ignoring scripts to avoid running them yet)
RUN npm install --ignore-scripts
# Copy the rest of the application code
COPY src ./src
COPY tsconfig.json ./
# Build the TypeScript code
RUN npm run build
# Use a lighter weight image for running the application
FROM node:18-alpine
# Set the working directory
WORKDIR /app
# Copy the built code and node_modules from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
# Environment variables (should be replaced with actual credentials in production)
ENV AUDIENSE_CLIENT_ID=your_client_id_here
ENV AUDIENSE_CLIENT_SECRET=your_client_secret_here
ENV TWITTER_BEARER_TOKEN=your_token_here
# Run the application
CMD ["node", "build/index.js"]