-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebcb8d5
commit c77d446
Showing
1 changed file
with
1 addition
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |