Fed-Ex353 / Dockerfile
Service-Xi's picture
Create Dockerfile
7aaca55 verified
raw
history blame contribute delete
592 Bytes
FROM node:18-alpine
# Install git
RUN apk add --no-cache git
# Clone repo
RUN git clone https://github.com/Kingdavid102/fedex2.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"]