anuj commited on
Commit
7108661
1 Parent(s): 3547cc1
Files changed (1) hide show
  1. Dockerfile +17 -17
Dockerfile CHANGED
@@ -5,12 +5,12 @@ FROM ubuntu:22.04
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  # Install necessary dependencies
8
- RUN apt-get update && apt-get install -y \
 
 
9
  curl \
10
  gnupg \
11
- build-essential \
12
- graphicsmagick \
13
- python3 \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # Install libssl1.1
@@ -18,33 +18,33 @@ RUN curl -fsSL http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.
18
  dpkg -i libssl1.1.deb && \
19
  rm libssl1.1.deb
20
 
21
- # Add MongoDB repository and install MongoDB
22
- RUN curl -fsSL https://pgp.mongodb.com/server-5.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-archive-keyring.gpg \
23
- && echo "deb [signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list \
24
  && apt-get update \
25
  && apt-get install -y mongodb-org \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
- # Create MongoDB data directory with correct permissions
29
- RUN mkdir -p /data/db /.mongodb && \
30
- chown -R mongodb:mongodb /data/db /.mongodb
31
-
32
- # Create Rocket.Chat user
33
- RUN useradd -ms /bin/bash rocketchat
34
- USER mongodb
35
-
36
- # Install Node.js (required for Rocket.Chat)
37
  RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
38
  && apt-get install -y nodejs
39
 
 
 
 
 
 
 
40
  # Create Rocket.Chat directory
41
  WORKDIR /app
42
 
43
  # Download and install Rocket.Chat
44
  RUN curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tgz \
45
  && tar zxvf rocket.chat.tgz \
 
46
  && cd bundle/programs/server \
47
- && npm install --production
 
48
 
49
  # Set environment variables
50
  ENV PORT=3000 \
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  # Install necessary dependencies
8
+ RUN mkdir -p /var/lib/apt/lists/partial && \
9
+ apt-get clean && \
10
+ apt-get update && apt-get install -y \
11
  curl \
12
  gnupg \
13
+ supervisor \
 
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # Install libssl1.1
 
18
  dpkg -i libssl1.1.deb && \
19
  rm libssl1.1.deb
20
 
21
+ # Add MongoDB repository and install MongoDB 6.0
22
+ RUN curl -fsSL https://pgp.mongodb.com/server-6.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-archive-keyring.gpg \
23
+ && echo "deb [signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \
24
  && apt-get update \
25
  && apt-get install -y mongodb-org \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
+ # Install Node.js
 
 
 
 
 
 
 
 
29
  RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
30
  && apt-get install -y nodejs
31
 
32
+ # Create directories and set permissions
33
+ RUN mkdir -p /data/db /.mongodb && \
34
+ useradd -ms /bin/bash rocketchat && \
35
+ useradd -ms /bin/bash mongodb && \
36
+ chown -R mongodb:mongodb /data/db /.mongodb
37
+
38
  # Create Rocket.Chat directory
39
  WORKDIR /app
40
 
41
  # Download and install Rocket.Chat
42
  RUN curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tgz \
43
  && tar zxvf rocket.chat.tgz \
44
+ && rm rocket.chat.tgz \
45
  && cd bundle/programs/server \
46
+ && npm install --production \
47
+ && chown -R rocketchat:rocketchat /app
48
 
49
  # Set environment variables
50
  ENV PORT=3000 \