-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfileQA
More file actions
37 lines (26 loc) · 819 Bytes
/
DockerfileQA
File metadata and controls
37 lines (26 loc) · 819 Bytes
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
# Stage 1: Build Stage
FROM node:22-alpine AS build
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the TypeScript files
RUN npm run build
# Stage 2: Deployment Stage
FROM node:22-alpine AS deploy
# Set the working directory inside the container
WORKDIR /app
# Copy only the necessary files from the build stage
COPY --from=build /app/package*.json ./
COPY --from=build /app/dist /app/dist
COPY .env.qa /app/.env
# Install only production dependencies
RUN npm install
# Expose the application port (adjust according to your app's port)
EXPOSE 8080
# Set the command to run the app (adjust for environment)
CMD ["npm", "run", "start"]