proxy1 / Dockerfile
anews9340's picture
Update Dockerfile
f304f4c verified
raw
history blame contribute delete
762 Bytes
# Use Node.js LTS as base image
FROM node:20-alpine
# Install basic utilities and create app directory
RUN apk add --no-cache curl && \
mkdir -p /usr/src/app && \
addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
WORKDIR /usr/src/app
# Copy all files
COPY . .
# Install dependencies
RUN npm install --omit=dev && \
chown -R nodejs:nodejs /usr/src/app
# Switch to non-root user for security
USER nodejs
# Health check to verify proxy is running
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:${PORT:-8080} || exit 1
# Expose port (Hugging Face Spaces will remap this)
EXPOSE 8080
EXPOSE 7860
# Start the proxy server
#CMD ["node", "simple-proxy.js"]
CMD ["node", "test.js"]