nxdev-org commited on
Commit
cadde18
·
1 Parent(s): 691869c

update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -24
Dockerfile CHANGED
@@ -5,8 +5,8 @@
5
  #
6
  # Features:
7
  # - Full TeX Live 2025 with Japanese support
8
- # - MongoDB 7.0 (more stable in containers)
9
- # - Redis 8.0 (pre-compiled)
10
  # - Port 7860
11
 
12
  FROM fifof16/sharelatex-with-texlive-full:latest
@@ -14,38 +14,42 @@ FROM fifof16/sharelatex-with-texlive-full:latest
14
  USER root
15
 
16
  # ============================================
17
- # STEP 1: DOWNLOAD MONGODB 7.0 (stable in containers)
18
  # ============================================
19
  RUN mkdir -p /opt/mongodb /usr/local/bin && \
20
  cd /opt/mongodb && \
21
  wget -q --no-check-certificate -O mongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.14.tgz && \
22
  tar xzf mongodb.tgz && \
23
  cp mongodb-linux-x86_64-ubuntu2204-7.0.14/bin/mongod /usr/local/bin/ && \
24
- cp mongodb-linux-x86_64-ubuntu2204-7.0.14/bin/mongosh /usr/local/bin/ || true && \
25
  rm -rf /opt/mongodb && \
26
- /usr/local/bin/mongod --version || true
27
 
28
- # Fallback: if mongosh wasn't included, download separately
29
- RUN if [ ! -f /usr/local/bin/mongosh ]; then \
30
- mkdir -p /opt/mongosh /usr/local/bin && \
 
31
  cd /opt/mongosh && \
32
- wget -q --no-check-certificate -O mongosh.tar.gz https://github.com/mongodb-js/mongosh/releases/download/v2.0.2/mongosh-2.0.2-linux-x64.tar.gz && \
33
- tar xzf mongosh.tar.gz && \
34
- cp mongosh-2.0.2-linux-x64/bin/mongosh /usr/local/bin/ && \
35
- rm -rf /opt/mongosh; \
36
- fi
37
 
38
  # ============================================
39
- # STEP 2: DOWNLOAD REDIS PRE-COMPILED
40
  # ============================================
41
- RUN mkdir -p /usr/local/bin && \
42
- wget -q --no-check-certificate -O /usr/local/bin/redis-server https://github.com/redis/redis/raw/8.0.0/src/redis-server && \
43
- wget -q --no-check-certificate -O /usr/local/bin/redis-cli https://github.com/redis/redis/raw/8.0.0/src/redis-cli && \
44
- chmod +x /usr/local/bin/redis-* && \
45
- redis-server --version || true
 
 
 
 
46
 
47
  # ============================================
48
- # STEP 3: REMOVE DEFAULT CHECK SCRIPTS
49
  # ============================================
50
  RUN rm -f /etc/my_init.d/500_check_db_access.sh 2>/dev/null || true
51
  RUN rm -f /etc/my_init.d/500_check_mongo.sh 2>/dev/null || true
@@ -53,13 +57,13 @@ RUN rm -f /etc/runit/mongo 2>/dev/null || true
53
  RUN rm -f /etc/runit/redis 2>/dev/null || true
54
 
55
  # ============================================
56
- # STEP 4: CREATE INIT SCRIPT
57
  # ============================================
58
  RUN cat > /etc/my_init.d/00_start_services.sh << 'EOFSCRIPT'
59
  #!/bin/bash
60
  set -e
61
 
62
- # Fix for TCMalloc in containers - disable per-CPU cache to avoid issues
63
  export GLIBC_TUNABLES=glibc.pthread.rseq=0
64
 
65
  echo "=== CREATING DIRECTORIES ==="
@@ -68,7 +72,7 @@ mkdir -p /var/log/mongodb /var/log/redis
68
  chmod -R 777 /data /var/log
69
  rm -f /data/mongo/mongod.lock /data/mongo/WiredTiger* 2>/dev/null || true
70
 
71
- echo "=== STARTING MONGODB (with TCMalloc fix) ==="
72
  pkill mongod 2>/dev/null || true
73
  sleep 2
74
 
@@ -116,7 +120,7 @@ EOFSCRIPT
116
  RUN chmod +x /etc/my_init.d/00_start_services.sh
117
 
118
  # ============================================
119
- # STEP 5: SET ENVIRONMENT
120
  # ============================================
121
  RUN mkdir -p /etc/container_environment
122
  RUN echo "mongodb://127.0.0.1:27017/sharelatex" > /etc/container_environment/OVERLEAF_MONGO_URL
 
5
  #
6
  # Features:
7
  # - Full TeX Live 2025 with Japanese support
8
+ # - MongoDB 7.0 (stable in containers)
9
+ # - Redis 8.6 (from bitnami/redis Docker image)
10
  # - Port 7860
11
 
12
  FROM fifof16/sharelatex-with-texlive-full:latest
 
14
  USER root
15
 
16
  # ============================================
17
+ # STEP 1: DOWNLOAD MONGODB 7.0 (VERIFIED OK)
18
  # ============================================
19
  RUN mkdir -p /opt/mongodb /usr/local/bin && \
20
  cd /opt/mongodb && \
21
  wget -q --no-check-certificate -O mongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.14.tgz && \
22
  tar xzf mongodb.tgz && \
23
  cp mongodb-linux-x86_64-ubuntu2204-7.0.14/bin/mongod /usr/local/bin/ && \
 
24
  rm -rf /opt/mongodb && \
25
+ /usr/local/bin/mongod --version
26
 
27
+ # ============================================
28
+ # STEP 2: DOWNLOAD MONGOSH (VERIFIED OK)
29
+ # ============================================
30
+ RUN mkdir -p /opt/mongosh /usr/local/bin && \
31
  cd /opt/mongosh && \
32
+ wget -q --no-check-certificate -O mongosh.tgz https://github.com/mongodb-js/mongosh/releases/download/v2.8.2/mongosh-2.8.2-linux-x64.tgz && \
33
+ tar xzf mongosh.tgz && \
34
+ cp mongosh-2.8.2-linux-x64/bin/mongosh /usr/local/bin/ && \
35
+ rm -rf /opt/mongosh && \
36
+ chmod +x /usr/local/bin/mongosh
37
 
38
  # ============================================
39
+ # STEP 3: COPY REDIS FROM LOCAL BINARY (copied from bitnami/redis)
40
  # ============================================
41
+ # Redis binary copied from bitnami/redis:8.6.2 Docker image
42
+ # Download command used:
43
+ # docker pull bitnami/redis
44
+ # docker create --name temp bitnami/redis
45
+ # docker cp temp:/opt/bitnami/redis/bin/redis-server ./
46
+ # docker cp temp:/opt/bitnami/redis/bin/redis-cli ./
47
+ # docker rm temp
48
+ COPY redis-server redis-cli /usr/local/bin/
49
+ RUN chmod +x /usr/local/bin/redis-* && redis-server --version
50
 
51
  # ============================================
52
+ # STEP 4: REMOVE DEFAULT CHECK SCRIPTS
53
  # ============================================
54
  RUN rm -f /etc/my_init.d/500_check_db_access.sh 2>/dev/null || true
55
  RUN rm -f /etc/my_init.d/500_check_mongo.sh 2>/dev/null || true
 
57
  RUN rm -f /etc/runit/redis 2>/dev/null || true
58
 
59
  # ============================================
60
+ # STEP 5: CREATE INIT SCRIPT
61
  # ============================================
62
  RUN cat > /etc/my_init.d/00_start_services.sh << 'EOFSCRIPT'
63
  #!/bin/bash
64
  set -e
65
 
66
+ # Fix for TCMalloc in containers
67
  export GLIBC_TUNABLES=glibc.pthread.rseq=0
68
 
69
  echo "=== CREATING DIRECTORIES ==="
 
72
  chmod -R 777 /data /var/log
73
  rm -f /data/mongo/mongod.lock /data/mongo/WiredTiger* 2>/dev/null || true
74
 
75
+ echo "=== STARTING MONGODB ==="
76
  pkill mongod 2>/dev/null || true
77
  sleep 2
78
 
 
120
  RUN chmod +x /etc/my_init.d/00_start_services.sh
121
 
122
  # ============================================
123
+ # STEP 6: SET ENVIRONMENT
124
  # ============================================
125
  RUN mkdir -p /etc/container_environment
126
  RUN echo "mongodb://127.0.0.1:27017/sharelatex" > /etc/container_environment/OVERLEAF_MONGO_URL