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