-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
41 lines (29 loc) · 961 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
40
41
# Build stage
FROM node:21 AS build-stage
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 application
RUN npm run build
# Production stage
FROM node:21-slim AS production-stage
WORKDIR /app
# Set CI environment variable to skip Husky setup
ENV CI=true
# Copy package.json and package-lock.json for production dependencies
COPY package*.json ./
# Install only production dependencies
RUN npm install --omit=dev
# Copy the built code from the build stage
COPY --from=build-stage /app/dist ./dist
COPY --from=build-stage /app/docker-entrypoint.sh ./docker-entrypoint.sh
# Copy the entrypoint script
RUN chmod +x docker-entrypoint.sh
# Define the command to run the application
# CMD [ "node", "dist/hedera-cli.js" ]
# Define the entrypoint script: Hang until the container is stopped
ENTRYPOINT [ "./docker-entrypoint.sh" ]