-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile
39 lines (27 loc) · 930 Bytes
/
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
# Stage 1: Build
FROM node:18 AS build
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json files to install dependencies
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of your application code to the container
COPY . .
# Install TypeScript globally
RUN npm install -g typescript
# Compile TypeScript to JavaScript
RUN tsc
# Stage 2: Run
FROM node:18 AS production
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy only the compiled JavaScript files and package.json to the new image
COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/package*.json ./
# Install only production dependencies
RUN npm install --only=production
# Expose the port your app runs on (default for Probot is 3000)
EXPOSE 3000
# Command to run your app using Probot
CMD ["npx", "probot", "run", "./dist/main.js"]