socket broker
Build and Push Docker Images / build-and-push (push) Failing after 1m39s

This commit is contained in:
2025-08-21 10:59:09 +02:00
parent 4470eb400a
commit bf404135b5
9 changed files with 2910 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy application code
COPY . .
# Create non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nodejs -u 1001
# Change ownership of the app directory
RUN chown -R nodejs:nodejs /app
USER nodejs
# Expose ports
EXPOSE 3000 8080
# Set default environment variables
ENV WS_PORT=3000
ENV API_PORT=8080
ENV API_KEY=default-api-key-change-me
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:8080/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"
# Start the application
CMD ["npm", "start"]