compose coolify
This commit is contained in:
1 parent
69833d2067
commit
dc93a8b652
3 files changed
+306
-8
No files matched your search
+6
-6
@@ -9,8 +9,8 @@ WORKDIR /app
|
||||
COPY package*.json ./
|
||||
COPY package-lock.json* ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci --only=production
|
||||
# Install ALL dependencies (including devDependencies for build)
|
||||
RUN npm ci
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
@@ -18,6 +18,9 @@ COPY . .
|
||||
# Build TypeScript
|
||||
RUN npm run build
|
||||
|
||||
# Prune devDependencies after build
|
||||
RUN npm prune --production
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine
|
||||
|
||||
@@ -32,9 +35,6 @@ 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 ./
|
||||
|
||||
# Copy environment configuration
|
||||
COPY --chown=nodejs:nodejs .env.example .env
|
||||
|
||||
# Switch to non-root user
|
||||
USER nodejs
|
||||
|
||||
@@ -46,4 +46,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
EXPOSE 3000
|
||||
|
||||
# Start application
|
||||
CMD ["node", "dist/main.js"]
|
||||
CMD ["node", "dist/main.js"]
|
||||
Reference in new issue
Block a user