File size: 869 Bytes
0b1afcf |
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 33 34 35 36 37 38 39 40 41 42 |
# Simple Remix app Dockerfile
FROM node:20-alpine
# Install basic dependencies
RUN apk add --no-cache curl tini
WORKDIR /app
# Create non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S remix -u 1001
# Copy package files
COPY package*.json ./
# Install ALL dependencies (needed for build)
RUN npm ci && npm cache clean --force
# Copy application code
COPY --chown=remix:nodejs . .
# Build the Remix app
RUN npm run build
# Remove dev dependencies after build
RUN npm prune --production && npm cache clean --force
# Switch to non-root user
USER remix
# Expose port 3000
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:3000 || exit 1
# Use tini for proper signal handling
ENTRYPOINT ["/sbin/tini", "--"]
# Start the application
CMD ["npm", "start"] |