Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
netsyncmali committed Jan 8, 2024
1 parent ebcb8d5 commit c77d446
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
FROM node:16

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Expose the application port
EXPOSE 2000

# Install Redis server
RUN apt-get update && \
apt-get install -y redis-server && \
rm -rf /var/lib/apt/lists/*

# Configure Redis to listen on port 6377 without a password
RUN sed -i 's/^bind .*$/bind 0.0.0.0/' /etc/redis/redis.conf && \
sed -i 's/^protected-mode yes$/protected-mode no/' /etc/redis/redis.conf && \
sed -i 's/^port 6379$/port 6377/' /etc/redis/redis.conf && \
sed -i '/^requirepass/ s/^/#/' /etc/redis/redis.conf

# Start Redis server and then the Node.js application
CMD ["bash", "-c", "redis-server --daemonize yes && npm start"]
CMD ["npm","start"]

0 comments on commit c77d446

Please sign in to comment.