Untitled

 avatar
unknown
plain_text
a year ago
695 B
5
Indexable
# Use the official Node.js image based on Alpine
FROM node:alpine

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json (if available)
COPY package*.json ./

# Install dependencies
RUN npm install

# If you're building your code for production
# RUN npm ci --only=production

# Copy the rest of your application code, including index.js
COPY . .

# Copy the wait-for-it.sh script
COPY wait-for-it.sh /usr/src/app/wait-for-it.sh
RUN chmod +x /usr/src/app/wait-for-it.sh

# Expose the port your app runs on
EXPOSE 3000

# Command to run your app
CMD ["./wait-for-it.sh", "redis", "6379", "--", "node", "index.js"]
Editor is loading...
Leave a Comment