diff --git a/Dockerfile b/Dockerfile index fe1ae78..a74e7af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] + diff --git a/Dockerfile.dev b/Dockerfile.dev index da97b4a..ec1b9ef 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index b8b0da3..6ee4e1f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ services: build: context: . dockerfile: Dockerfile + platform: linux/amd64 ports: - "8000:8000" - "6379:6379"