-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (59 loc) · 1.93 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM node:22.11.0-bookworm
# Install dependencies for Buildah and Docker
RUN apt-get update \
&& apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
software-properties-common \
python3-pip python3-dev unzip \
iptables
# Install AWS CLI v2
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
ARCH="amd64"; \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \
elif [ "$ARCH" = "aarch64" ]; then \
ARCH="arm64"; \
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip aws
# Set AWS CLI pager to empty
RUN aws configure set cli_pager ""
# install kubectl
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
ARCH="amd64"; \
elif [ "$ARCH" = "aarch64" ]; then \
ARCH="arm64"; \
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$ARCH/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# Install Helm
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \
&& chmod 700 get_helm.sh \
&& ./get_helm.sh
RUN helm version --short
# Create the working directory
WORKDIR /usr/src/app
# Copy package files and install npm dependencies
COPY --chown=node:node package*.json /usr/src/app/
RUN npm clean-install
# Copy source files
COPY --chown=node:node . /usr/src/app/
RUN mkdir /usr/src/app/image-cache
# Build the Node.js application
RUN npm run build
# Set the user to root to run Buildah if needed
USER root
VOLUME /var/lib/containers
# Start the application
CMD [ "npm", "start" ]