Use aws-cli APK instead.

This commit is contained in:
Patrick Fic
2025-11-05 06:34:44 -08:00
parent 40b2e0fdf7
commit f4b34a956a
3 changed files with 9 additions and 28 deletions

View File

@@ -2,13 +2,6 @@
# Build stage for libraries
FROM node:22-alpine AS builder
# Install build dependencies including AWS CLI v2
RUN apk add --no-cache bash wget curl unzip gcompat
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip aws/
# Node.js application build stage
WORKDIR /usr/src/app
COPY package*.json ./
@@ -26,14 +19,10 @@ RUN echo "https://dl-cdn.alpinelinux.org/alpine/v$(grep -oE '[0-9]+\.[0-9]+' /et
RUN apk update
# Install runtime dependencies including AWS CLI v2
RUN apk add --no-cache bash redis ghostscript graphicsmagick imagemagick libjpeg-turbo libpng libwebp tiff libheif libde265 x265 ffmpeg curl unzip gcompat tzdata
RUN apk add --no-cache bash redis ghostscript graphicsmagick imagemagick libjpeg-turbo libpng libwebp tiff libheif libde265 x265 ffmpeg curl tzdata aws-cli
# # Install AWS CLI v2
# RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
# unzip awscliv2.zip && \
# ./aws/install && \
# rm -rf awscliv2.zip aws/ && \
# aws --version
# Verify AWS CLI installation
RUN aws --version
RUN npm install -g pm2
@@ -53,4 +42,6 @@ COPY --from=builder /usr/src/app/ecosystem.config.cjs ./ecosystem.config.cjs
EXPOSE 8000
## Only the below line differs.
CMD ["sh", "-c", "redis-server --daemonize yes && pm2-runtime ecosystem.config.cjs"]

View File

@@ -2,13 +2,6 @@
# Build stage for libraries
FROM node:22-alpine AS builder
# Install build dependencies including AWS CLI v2
RUN apk add --no-cache bash wget curl unzip gcompat
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip aws/
# Node.js application build stage
WORKDIR /usr/src/app
COPY package*.json ./
@@ -26,14 +19,10 @@ RUN echo "https://dl-cdn.alpinelinux.org/alpine/v$(grep -oE '[0-9]+\.[0-9]+' /et
RUN apk update
# Install runtime dependencies including AWS CLI v2
RUN apk add --no-cache bash redis ghostscript graphicsmagick imagemagick libjpeg-turbo libpng libwebp tiff libheif libde265 x265 ffmpeg curl unzip gcompat tzdata
RUN apk add --no-cache bash redis ghostscript graphicsmagick imagemagick libjpeg-turbo libpng libwebp tiff libheif libde265 x265 ffmpeg curl tzdata aws-cli
# Install AWS CLI v2
# RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
# unzip awscliv2.zip && \
# ./aws/install && \
# rm -rf awscliv2.zip aws/ && \
# aws --version
# Verify AWS CLI installation
RUN aws --version
RUN npm install -g pm2

View File

@@ -6,6 +6,7 @@ services:
build:
context: .
dockerfile: Dockerfile
platform: linux/amd64
ports:
- "8000:8000"
- "6379:6379"