first commit
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
FROM node:22.14.0-alpine AS builder
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Salin package.json dan package-lock.json
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Salin semua file source code
|
||||
COPY . .
|
||||
|
||||
# (Opsional) Jalankan sebagai non-root user
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
USER appuser
|
||||
|
||||
# Ekspos port
|
||||
EXPOSE 4000
|
||||
|
||||
# Perintah untuk menjalankan aplikasi
|
||||
CMD [ "node", "src/server.js" ]
|
||||
Reference in New Issue
Block a user