File tree Expand file tree Collapse file tree 17 files changed +53
-245
lines changed
nodejs-react-postgres/client Expand file tree Collapse file tree 17 files changed +53
-245
lines changed Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Create and change to the app directory
16
5
WORKDIR /app
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory
16
5
WORKDIR /app
17
6
18
7
# Copy package.json and package-lock.json
19
8
COPY package*.json ./
20
9
21
- # Install dependencies
10
+ # Install dependencies using npm ci for a clean install
22
11
RUN npm ci
23
12
24
13
# Copy the rest of the application source code
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory
16
5
WORKDIR /app
17
6
18
7
# Copy package.json and package-lock.json
19
8
COPY package*.json ./
20
9
21
- # Install dependencies
10
+ # Install dependencies using npm ci for a clean install
22
11
RUN npm ci
23
12
24
13
# Copy the rest of the application source code
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory
16
5
WORKDIR /app
17
6
18
7
# Copy package.json and package-lock.json
19
8
COPY package*.json ./
20
9
21
- # Install dependencies
10
+ # Install dependencies using npm ci for a clean install
22
11
RUN npm ci
23
12
24
13
# Copy the rest of the application source code
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory
16
5
WORKDIR /usr/src/app
17
6
18
- # Copy package.json to the working directory
19
- COPY package.json ./
7
+ # Copy package.json and package-lock.json if available
8
+ COPY package* .json ./
20
9
21
10
# Install dependencies
22
11
RUN npm install
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_18.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory to /app
16
5
WORKDIR /app
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory to /app
16
5
WORKDIR /app
@@ -28,4 +17,4 @@ COPY . .
28
17
EXPOSE 3000
29
18
30
19
# Run the app when the container launches
31
- ENTRYPOINT [ "node" , "main.js" ]
20
+ ENTRYPOINT ["node" , "main.js" ]
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory to /app
16
5
WORKDIR /app
17
6
18
7
# Copy package.json and package-lock.json into the container at /app
19
8
COPY package*.json ./
20
9
21
- # Install any needed packages specified in package.json
10
+ # Install any needed packages specified in package.json using npm ci for a clean install
22
11
RUN npm ci
23
12
24
13
# Copy the current directory contents into the container at /app
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_18.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory to /app
16
5
WORKDIR /app
Original file line number Diff line number Diff line change 1
- # Use the slim version of Debian Bookworm as the base image
2
- FROM debian:bookworm-slim
3
-
4
- # Set environment variables to avoid interactive prompts during package installation
5
- ENV DEBIAN_FRONTEND=noninteractive
6
-
7
- # Update the package list and install Node.js, npm, and any other dependencies
8
- RUN apt-get update && apt-get install -y \
9
- curl \
10
- && curl -sL https://deb.nodesource.com/setup_20.x | bash - \
11
- && apt-get install -y nodejs \
12
- && apt-get clean \
13
- && rm -rf /var/lib/apt/lists/*
1
+ # Use the slim version of Node.js on Debian Bookworm as the base image
2
+ FROM node:bookworm-slim
14
3
15
4
# Set the working directory to /app
16
5
WORKDIR /app
17
6
18
7
# Copy package.json and package-lock.json into the container at /app
19
8
COPY package*.json ./
20
9
21
- # Install any needed packages specified in package.json
10
+ # Install any needed packages specified in package.json using npm ci for a clean install
22
11
RUN npm ci
23
12
24
13
# Copy the current directory contents into the container at /app
You can’t perform that action at this time.
0 commit comments