forked from moodlehq/moodleapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 836 Bytes
/
Dockerfile
File metadata and controls
32 lines (24 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Multi-stage build for Aspire OTA Backend
# This Dockerfile is at repo root to work with Coolify
FROM node:20-alpine AS builder
WORKDIR /app
COPY ota-backend/package*.json ./
RUN npm ci
COPY ota-backend/ ./
RUN npm run build
FROM node:20-alpine
WORKDIR /app
# Create non-root user
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
# Copy built application
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nodejs:nodejs /app/package.json ./
# Create data directory for version metadata
RUN mkdir -p data && chown nodejs:nodejs data
USER nodejs
EXPOSE 3000
ENV NODE_ENV=production
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "dist/app.js"]