0duaansa commited on
Commit
9913b86
·
verified ·
1 Parent(s): 5992270

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -13
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  # Sử dụng base image
2
  FROM buildpack-deps:22.04-curl
3
 
4
- # Cài đặt các công cụ cần thiết để biên dịch Redis và Python
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  build-essential \
7
  curl \
@@ -9,8 +9,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
9
  net-tools \
10
  vim \
11
  locales \
12
- python3 \
13
- python3-pip \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # Cài đặt Redis phiên bản mới nhất
@@ -22,9 +20,6 @@ RUN wget http://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz \
22
  && make && make install \
23
  && cd .. && rm -rf redis-${REDIS_VERSION}
24
 
25
- # Cài đặt Flask và các thư viện Python cần thiết
26
- RUN pip3 install --no-cache-dir flask redis
27
-
28
  # Sao chép file cấu hình Redis
29
  COPY redis.conf /etc/redis/redis.conf
30
 
@@ -40,17 +35,14 @@ RUN groupadd --gid $USER_GID $USERNAME \
40
  USER $USERNAME
41
  WORKDIR /data
42
 
43
- # Sao chép mã nguồn web app
44
- COPY app.py /data/app.py
45
-
46
  # Cấu hình biến môi trường
47
  ENV LANG=C.UTF-8 \
48
  LC_ALL=C.UTF-8 \
49
  HOME=/data \
50
  REDIS_CONFIG_FILE=/etc/redis/redis.conf
51
 
52
- # Expose cổng Redis và Flask
53
- EXPOSE 6379 5000
54
 
55
- # Command chạy Redis web server song song
56
- CMD ["bash", "-c", "redis-server /etc/redis/redis.conf & python3 /data/app.py"]
 
1
  # Sử dụng base image
2
  FROM buildpack-deps:22.04-curl
3
 
4
+ # Cài đặt các công cụ cần thiết để biên dịch Redis
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  build-essential \
7
  curl \
 
9
  net-tools \
10
  vim \
11
  locales \
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # Cài đặt Redis phiên bản mới nhất
 
20
  && make && make install \
21
  && cd .. && rm -rf redis-${REDIS_VERSION}
22
 
 
 
 
23
  # Sao chép file cấu hình Redis
24
  COPY redis.conf /etc/redis/redis.conf
25
 
 
35
  USER $USERNAME
36
  WORKDIR /data
37
 
 
 
 
38
  # Cấu hình biến môi trường
39
  ENV LANG=C.UTF-8 \
40
  LC_ALL=C.UTF-8 \
41
  HOME=/data \
42
  REDIS_CONFIG_FILE=/etc/redis/redis.conf
43
 
44
+ # Expose cổng Redis
45
+ EXPOSE 6379
46
 
47
+ # Command chạy Redis với cấu hình
48
+ RUN [ "redis-server", "/etc/redis/redis.conf" ]