fix: use ubuntu:22.04 base image with NodeSource Node.js 20 in Dockerfile

This commit is contained in:
2026-08-10 07:45:59 +00:00
parent 4f91be13f6
commit 944f9196e1
+6 -3
View File
@@ -11,20 +11,23 @@ RUN npm ci
COPY . .
RUN VITE_API_URL=$VITE_API_URL npm run build
# Stage 2: Production environment with Node.js, Nginx, and MongoDB Community Edition (ARM64 & AMD64 native support via Ubuntu 22.04 Jammy)
FROM node:20-jammy
# Stage 2: Production environment with Node.js, Nginx, and MongoDB Community Edition (ARM64 & AMD64 native support via Ubuntu 22.04)
FROM ubuntu:22.04
WORKDIR /app
# Prevent interactive prompts during apt install
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies needed for MongoDB repo and general setup
# Install dependencies needed for Node.js, MongoDB repo, and general setup
RUN apt-get update && apt-get install -y \
gnupg \
curl \
ca-certificates \
nginx \
procps \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Add MongoDB official GPG key and repository (MongoDB 8.0 for Ubuntu 22.04 Jammy - supports arm64 and amd64 natively)