Spaces:
Paused
Paused
File size: 592 Bytes
03980e4 1389f9e 03980e4 |
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 |
FROM node:18-alpine
# Install git
RUN apk add --no-cache git
# Clone repo
RUN git clone https://github.com/Kingdavid102/fedex1.git /app
# Set working directory
WORKDIR /app
# Install dependencies
RUN npm install
# Create uploads & products.json inside /app with correct permissions
RUN mkdir -p /app/uploads && \
touch /app/products.json && \
chown -R node:node /app && \
chmod -R 755 /app/uploads && \
chmod 644 /app/products.json
# Switch to non-root user
USER node
# Environment variables
ENV PORT=7860
ENV NODE_ENV=production
EXPOSE 7860
CMD ["node", "server.js"] |