Add Dashboard service Dockerfile
This commit is contained in:
37
services/dashboard/Dockerfile
Normal file
37
services/dashboard/Dockerfile
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
python3 \
|
||||||
|
make \
|
||||||
|
g++
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm ci --only=production
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
|
COPY src/ ./src/
|
||||||
|
|
||||||
|
# Create necessary directories
|
||||||
|
RUN mkdir -p /app/logs /app/public/css /app/public/js /app/public/assets
|
||||||
|
|
||||||
|
# Run as non-root user
|
||||||
|
RUN addgroup -g 1001 -S nodejs
|
||||||
|
RUN adduser -S dashboard -u 1001
|
||||||
|
RUN chown -R dashboard:nodejs /app
|
||||||
|
USER dashboard
|
||||||
|
|
||||||
|
# Health check
|
||||||
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
|
CMD node src/healthcheck.js || exit 1
|
||||||
|
|
||||||
|
# Expose port
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
# Start the service
|
||||||
|
CMD ["node", "src/app.js"]
|
Reference in New Issue
Block a user