nxdev-org commited on
Commit
91f1417
·
verified ·
1 Parent(s): 09fefdc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -40
Dockerfile CHANGED
@@ -1,48 +1,29 @@
1
- FROM ubuntu:latest
 
2
 
3
- # 非対面でのインストール設定
4
- ENV DEBIAN_FRONTEND=noninteractive
5
- ENV DOCKER_HOST=unix:///var/run/docker.sock
6
 
7
- # 必要なパッケージのインストール
8
- RUN apt-get update && apt-get install -y \
9
- git \
10
- docker.io \
11
- docker-compose \
12
- curl \
13
- sed \
14
- python3-pip \
15
- python3-venv \
16
- && rm -rf /var/lib/apt/lists/*
17
 
18
- WORKDIR /app
 
 
19
 
20
- # Toolkitのクローン
21
- RUN git clone https://github.com/overleaf/toolkit.git /app/toolkit
22
- WORKDIR /app/toolkit
23
 
24
- RUN python3 -m venv /opt/venv
 
 
25
 
26
- # Add it to the PATH (this "activates" it for the rest of the Dockerfile)
27
- ENV PATH="/opt/venv/bin:$PATH"
 
28
 
29
- # Install setuptools (this provides the distutils functionality)
30
- RUN pip install setuptools
31
 
32
- # Toolkitの初期化
33
- RUN bin/init
34
-
35
-
36
-
37
- # --- Hugging Face 用の重要な設定変更 ---
38
- # 1. 公開ポートを 80 から 7860 に変更
39
- RUN sed -i 's/OVERLEAF_PORT=80/OVERLEAF_PORT=7860/g' config/overleaf.rc
40
-
41
- # 2. 外部からアクセスできるよう LISTEN_IP を 0.0.0.0 に固定
42
- RUN sed -i 's/OVERLEAF_LISTEN_IP=127.0.0.1/OVERLEAF_LISTEN_IP=0.0.0.0/g' config/overleaf.rc
43
-
44
- # 権限の調整(Hugging Faceの実行ユーザーに対応させるため)
45
- RUN chmod -R 777 /app/toolkit
46
-
47
- # Overleaf Toolkitを起動
48
- CMD ["bin/up"]
 
1
+ # Use the community all-in-one image for Overleaf Extended
2
+ FROM shantanupatil01/overleaf-extended:latest
3
 
4
+ # --- Hugging Face Specific Configuration ---
 
 
5
 
6
+ # 1. Force Overleaf to listen on port 7860 (Hugging Face requirement)
7
+ ENV OVERLEAF_PORT=7860
8
+ ENV SHARELATEX_PORT=7860
 
 
 
 
 
 
 
9
 
10
+ # 2. Ensure it binds to all interfaces for external access
11
+ ENV OVERLEAF_LISTEN_IP=0.0.0.0
12
+ ENV SHARELATEX_LISTEN_IP=0.0.0.0
13
 
14
+ # 3. Set the public URL (Replace with your actual Space URL for full functionality)
15
+ ENV SHARELATEX_SITE_URL=https://huggingface.co
 
16
 
17
+ # 4. Optional: Configure internal DB URLs if needed (Defaults usually work in all-in-one)
18
+ ENV OVERLEAF_MONGO_URL=mongodb://localhost:27017/overleaf
19
+ ENV OVERLEAF_REDIS_HOST=localhost
20
 
21
+ # Hugging Face runs as a non-root user (UID 1000)
22
+ # We ensure the app directory is writable
23
+ RUN chmod -R 777 /var/lib/overleaf /var/log/overleaf
24
 
25
+ # Expose the mandatory Hugging Face port
26
+ EXPOSE 7860
27
 
28
+ # The base image already has its own CMD/Entrypoint to start Mongo, Redis, and Overleaf.
29
+ # If you need to override it, ensure you start all internal services.