Greg-House commited on
Commit
00b5c87
·
verified ·
1 Parent(s): 7bd54f5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -55
Dockerfile CHANGED
@@ -1,65 +1,33 @@
1
- # Start with official Nextcloud
2
  FROM nextcloud:apache
3
 
4
- # 1. Install Collabora (CODE)
5
- # We split this into small steps so the build doesn't time out
6
- USER root
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  wget \
9
  gnupg \
10
- lsb-release \
11
- ca-certificates
12
-
13
- # Download Key and Add Repo (Specific for Debian Bookworm/Nextcloud)
14
- RUN wget -qO /usr/share/keyrings/collaboraonline-release-keyring.gpg https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg && \
15
- echo "deb [signed-by=/usr/share/keyrings/collaboraonline-release-keyring.gpg] https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian12 ./" > /etc/apt/sources.list.d/collaboraonline.list
16
-
17
- # Install the Editor Engine
18
- RUN apt-get update && apt-get install -y --no-install-recommends \
19
- coolwsd \
20
- collabora-online-brand && \
21
- rm -rf /var/lib/apt/lists/*
22
-
23
- # 2. Configure the Editor (Internal)
24
- # Disable SSL (since HF handles SSL) and allow all domains
25
- RUN coolconfig set ssl.enable false && \
26
- coolconfig set ssl.termination true && \
27
- coolconfig set storage.wopi.host ".*"
28
-
29
- # 3. Configure Apache (The Web Server)
30
- # Change Port 80 -> 7860 (Required by HF)
31
- RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf
32
-
33
- # Enable Apache modules needed to talk to the Editor
34
- RUN a2enmod proxy proxy_http proxy_wstunnel
35
-
36
- # Add the internal connection logic directly to the main config
37
- # (This connects http://localhost:7860/cool -> http://localhost:9980)
38
- RUN sed -i '/DocumentRoot/a \
39
- ProxyPreserveHost On \n\
40
- ProxyPass /browser http://127.0.0.1:9980/browser retry=0 \n\
41
- ProxyPassReverse /browser http://127.0.0.1:9980/browser \n\
42
- ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0 \n\
43
- ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discovery \n\
44
- ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0 \n\
45
- ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities \n\
46
- ProxyPassMatch "/cool/(.*)/ws$" ws://127.0.0.1:9980/cool/$1/ws nocanon \n\
47
- ProxyPass /cool/adminws ws://127.0.0.1:9980/cool/adminws \n\
48
- ProxyPass /cool http://127.0.0.1:9980/cool \n\
49
- ProxyPassReverse /cool http://127.0.0.1:9980/cool' /etc/apache2/sites-available/000-default.conf
50
-
51
- # 4. Startup Script
52
- # Starts Editor in background, Nextcloud in foreground
53
  RUN echo '#!/bin/bash\n\
54
- # Ensure permissions\n\
55
- chown -R cool:cool /var/lib/coolwsd /var/cache/coolwsd\n\
56
- \n\
57
- echo "Starting Editor..."\n\
58
  su -s /bin/bash cool -c "/usr/bin/coolwsd" &\n\
59
- \n\
60
- echo "Starting Nextcloud..."\n\
61
- exec /entrypoint.sh apache2-foreground' > /start.sh && \
62
- chmod +x /start.sh
63
 
 
64
  EXPOSE 7860
65
  CMD ["/start.sh"]
 
 
1
  FROM nextcloud:apache
2
 
3
+ # 1. Install Collabora and dependencies
4
+ # We verify the key download to prevent build failures
 
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  wget \
7
  gnupg \
8
+ ca-certificates \
9
+ && wget -qO /usr/share/keyrings/collaboraonline-release-keyring.gpg https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg \
10
+ && echo "deb [signed-by=/usr/share/keyrings/collaboraonline-release-keyring.gpg] https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian12 ./" > /etc/apt/sources.list.d/collaboraonline.list \
11
+ && apt-get update \
12
+ && apt-get install -y --no-install-recommends coolwsd collabora-online-brand \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # 2. Basic Setup
16
+ # - Set Apache to Port 7860 (Mandatory for HF Spaces)
17
+ # - Disable Collabora SSL (It runs locally)
18
+ RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/000-default.conf \
19
+ && coolconfig set ssl.enable false \
20
+ && coolconfig set ssl.termination true
21
+
22
+ # 3. Simple Start Script
23
+ # Just starts the two services. No complex config injection.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  RUN echo '#!/bin/bash\n\
25
+ # Start Collabora in background\n\
 
 
 
26
  su -s /bin/bash cool -c "/usr/bin/coolwsd" &\n\
27
+ # Start Nextcloud in foreground\n\
28
+ exec /entrypoint.sh apache2-foreground' > /start.sh \
29
+ && chmod +x /start.sh
 
30
 
31
+ # 4. Run
32
  EXPOSE 7860
33
  CMD ["/start.sh"]