Update Dockerfile
Browse files- Dockerfile +49 -10
Dockerfile
CHANGED
@@ -1,16 +1,55 @@
|
|
1 |
-
# Use the official Ubuntu 18.04 image as a base
|
2 |
-
FROM ubuntu:18.04
|
3 |
|
4 |
-
# Expose the default Redis port
|
5 |
-
EXPOSE 7860
|
6 |
|
7 |
-
# Update the system and install Redis
|
8 |
-
RUN apt-get update && apt-get install -y redis-server
|
9 |
|
10 |
-
RUN mkdir -p /etc/lib/redis
|
11 |
-
RUN chmod -R 777 /etc/lib/redis
|
12 |
|
13 |
-
COPY redis.conf /etc/redis/redis.conf
|
14 |
|
15 |
-
# Run the Redis server as the main process with the configuration file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
CMD ["redis-server", "/etc/redis/redis.conf"]
|
|
|
|
|
|
|
|
1 |
+
# # Use the official Ubuntu 18.04 image as a base
|
2 |
+
# FROM ubuntu:18.04
|
3 |
|
4 |
+
# # Expose the default Redis port
|
5 |
+
# EXPOSE 7860
|
6 |
|
7 |
+
# # Update the system and install Redis
|
8 |
+
# RUN apt-get update && apt-get install -y redis-server
|
9 |
|
10 |
+
# RUN mkdir -p /etc/lib/redis
|
11 |
+
# RUN chmod -R 777 /etc/lib/redis
|
12 |
|
13 |
+
# COPY redis.conf /etc/redis/redis.conf
|
14 |
|
15 |
+
# # Run the Redis server as the main process with the configuration file
|
16 |
+
# CMD ["redis-server", "/etc/redis/redis.conf"]
|
17 |
+
|
18 |
+
|
19 |
+
#
|
20 |
+
# Redis Dockerfile
|
21 |
+
#
|
22 |
+
# https://github.com/dockerfile/redis
|
23 |
+
#
|
24 |
+
|
25 |
+
# Pull base image.
|
26 |
+
FROM dockerfile/ubuntu
|
27 |
+
|
28 |
+
# Install Redis.
|
29 |
+
RUN \
|
30 |
+
cd /tmp && \
|
31 |
+
wget http://download.redis.io/redis-stable.tar.gz && \
|
32 |
+
tar xvzf redis-stable.tar.gz && \
|
33 |
+
cd redis-stable && \
|
34 |
+
make && \
|
35 |
+
make install && \
|
36 |
+
cp -f src/redis-sentinel /usr/local/bin && \
|
37 |
+
mkdir -p /etc/redis && \
|
38 |
+
cp -f *.conf /etc/redis && \
|
39 |
+
rm -rf /tmp/redis-stable* && \
|
40 |
+
sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \
|
41 |
+
sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \
|
42 |
+
sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf && \
|
43 |
+
sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
|
44 |
+
|
45 |
+
# Define mountable directories.
|
46 |
+
VOLUME ["/data"]
|
47 |
+
|
48 |
+
# Define working directory.
|
49 |
+
WORKDIR /data
|
50 |
+
|
51 |
+
# Define default command.
|
52 |
CMD ["redis-server", "/etc/redis/redis.conf"]
|
53 |
+
|
54 |
+
# Expose ports.
|
55 |
+
EXPOSE 6379
|