initial commit
All checks were successful
Build and Push to ACR / Build and Push (push) Successful in 45s
All checks were successful
Build and Push to ACR / Build and Push (push) Successful in 45s
Change-Id: Iccb9a69a29ce96d618762c5c852c8ec43d9b78df
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
# ---- Dependency install stage ----
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# ---- Runtime stage ----
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# Non-root user
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
USER appuser
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY package.json ./
|
||||
COPY src/ ./src/
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD wget -qO- http://localhost:3000/health | grep -q 'UP' || exit 1
|
||||
|
||||
CMD ["node", "src/index.js"]
|
||||
Reference in New Issue
Block a user