Docker-ImageManagementOptim.../os-base/ubuntu/Dockerfile

28 lines
565 B
Docker

# Gunakan image Ubuntu
FROM ubuntu:22.04
# Install curl, nodejs, dan npm
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Set direktori kerja di container
WORKDIR /app
# Salin package.json dan package-lock.json terlebih dahulu
COPY package*.json ./
# Jalankan npm install
RUN npm install
# Salin seluruh source code
COPY . .
# Jalankan app di port 3000 (opsional)
EXPOSE 3000
# Jalankan app
CMD ["node", "app.js"]