Skip to content

Commit fc1fea3

Browse files
committed
unified dockerfiles
1 parent 7fdd53b commit fc1fea3

File tree

19 files changed

+318
-60
lines changed

19 files changed

+318
-60
lines changed

samples/angular-express/backend/Dockerfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use the official Node.js image
2-
FROM node:20-alpine
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/*
314

415
# Create and change to the app directory
516
WORKDIR /app
@@ -15,3 +26,6 @@ COPY . .
1526

1627
# Expose the port the app runs on
1728
EXPOSE 3000
29+
30+
# Define the command to run your application
31+
CMD ["npm", "start"]

samples/bullmq-bullboard-redis/api/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use the official Node.js 14 LTS image as the base image
2-
FROM node:20-alpine
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/*
314

415
# Set the working directory
516
WORKDIR /app
@@ -14,4 +25,4 @@ RUN npm ci
1425
COPY . .
1526

1627
# Define the command to run the application
17-
CMD ["node", "index.mjs"]
28+
CMD ["node", "index.mjs"]

samples/bullmq-bullboard-redis/board/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use the official Node.js 14 LTS image as the base image
2-
FROM node:20-alpine
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/*
314

415
# Set the working directory
516
WORKDIR /app
@@ -14,4 +25,4 @@ RUN npm ci
1425
COPY . .
1526

1627
# Define the command to run the application
17-
CMD ["node", "index.mjs"]
28+
CMD ["node", "index.mjs"]

samples/bullmq-bullboard-redis/compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
- BOARD_PASSWORD
1414
- QUEUE
1515
depends_on:
16-
- redis
16+
- redisx
1717
#deploy:
1818
# resources:
1919
# reservations:
@@ -32,7 +32,7 @@ services:
3232
- REDIS=redis://redisx:6379
3333
- QUEUE
3434
depends_on:
35-
- redis
35+
- redisx
3636
#deploy:
3737
# resources:
3838
# reservations:
@@ -51,7 +51,7 @@ services:
5151
healthcheck:
5252
test: ["CMD", "wget", "-q", "--spider", "127.0.0.1:3000"]
5353
depends_on:
54-
- redis
54+
- redisx
5555
#deploy:
5656
# resources:
5757
# reservations:

samples/bullmq-bullboard-redis/worker/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use the official Node.js 14 LTS image as the base image
2-
FROM node:20-alpine
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/*
314

415
# Set the working directory
516
WORKDIR /app
@@ -14,4 +25,4 @@ RUN npm ci
1425
COPY . .
1526

1627
# Define the command to run the application
17-
CMD ["node", "index.mjs"]
28+
CMD ["node", "index.mjs"]

samples/feathersjs/src/Dockerfile

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1-
FROM node:latest
1+
# Use the slim version of Debian Bookworm as the base image
2+
FROM debian:bookworm-slim
23

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/*
14+
15+
# Set the working directory
316
WORKDIR /usr/src/app
417

18+
# Copy package.json to the working directory
519
COPY package.json ./
620

21+
# Install dependencies
722
RUN npm install
823

9-
COPY * ./
24+
# Copy the rest of the application source code
25+
COPY . ./
1026

27+
# Expose port 3030
1128
EXPOSE 3030
1229

13-
CMD [ "node", "index.js" ]
30+
# Define the command to run the application
31+
CMD ["node", "index.js"]

samples/nodejs-chatroom/app/Dockerfile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use an official Node runtime based on Alpine as a parent image
2-
FROM node:18-alpine
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/*
314

415
# Set the working directory to /app
516
WORKDIR /app
@@ -13,8 +24,8 @@ RUN npm install
1324
# Bundle app source
1425
COPY . .
1526

16-
#Make port 3000 available to the world outside this container
27+
# Make port 3000 available to the world outside this container
1728
EXPOSE 3000
1829

1930
# Run the app when the container launches
20-
CMD ["node", "main.js"]
31+
CMD ["node", "main.js"]

samples/nodejs-express/app/Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use an official Node runtime based on Alpine as a parent image
2-
FROM node:20-alpine
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/*
314

415
# Set the working directory to /app
516
WORKDIR /app

samples/nodejs-form/app/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use an official Node runtime based on Alpine as a parent image
2-
FROM node:20-alpine
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/*
314

415
# Set the working directory to /app
516
WORKDIR /app
@@ -17,4 +28,4 @@ COPY . .
1728
EXPOSE 3000
1829

1930
# Run the app when the container launches
20-
ENTRYPOINT [ "node", "main.js" ]
31+
ENTRYPOINT ["node", "main.js"]

samples/nodejs-http/app/Dockerfile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# Use an official Node runtime based on Alpine as a parent image
2-
FROM node:18-alpine
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/*
314

415
# Set the working directory to /app
516
WORKDIR /app
@@ -8,4 +19,4 @@ WORKDIR /app
819
COPY . .
920

1021
# Run the app when the container launches
11-
ENTRYPOINT [ "node", "main.js" ]
22+
ENTRYPOINT ["node", "main.js"]

0 commit comments

Comments
 (0)