docker file

This commit is contained in:
Jake Kasper
2025-09-03 11:20:18 -04:00
parent c62da14a92
commit 1826bf2702
2 changed files with 9 additions and 15 deletions

View File

@@ -12,13 +12,10 @@ RUN npm install --only=production --silent
# Copy source code
COPY . .
# Create non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S turftracker -u 1001
# Change ownership of the app directory
RUN chown -R turftracker:nodejs /app
USER turftracker
# Use the pre-created non-root user from the Node image
# and ensure ownership is correct
RUN chown -R node:node /app
USER node
# Expose port
EXPOSE 5000
@@ -28,4 +25,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD node healthcheck.js
# Start the application
CMD ["npm", "start"]
CMD ["npm", "start"]