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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +81 -32
Dockerfile CHANGED
@@ -1,33 +1,82 @@
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"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ # --------------------------
6
+ # Install dependencies
7
+ # --------------------------
8
+ RUN apt-get update && apt-get install -y \
9
+ apache2 \
10
+ php php-fpm php-gd php-xml php-mbstring php-zip php-curl php-mysql \
11
+ php-intl php-bz2 php-imagick php-gmp php-bcmath \
12
+ mariadb-server \
13
+ wget curl gnupg lsb-release apt-transport-https \
14
+ supervisor \
15
+ libreoffice \
16
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
17
+
18
+ # --------------------------
19
+ # Install Nextcloud
20
+ # --------------------------
21
+ WORKDIR /var/www/html
22
+ RUN wget https://download.nextcloud.com/server/releases/latest.tar.bz2 \
23
+ && tar -xjf latest.tar.bz2 --strip 1 \
24
+ && rm latest.tar.bz2 \
25
+ && chown -R www-data:www-data /var/www/html
26
+
27
+ # --------------------------
28
+ # Install Collabora CODE
29
+ # --------------------------
30
+ RUN echo "deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb/ /" \
31
+ | tee /etc/apt/sources.list.d/collabora.list \
32
+ && wget --no-check-certificate \
33
+ https://collaboraoffice.com/repos/CollaboraOnline/CODE-deb-key.gpg \
34
+ -O /etc/apt/trusted.gpg.d/collabora.gpg \
35
  && apt-get update \
36
+ && apt-get install -y loolwsd code-brand \
37
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
38
+
39
+ # --------------------------
40
+ # Configure Apache (Nextcloud)
41
+ # --------------------------
42
+ RUN a2enmod rewrite headers env dir mime setenvif ssl proxy proxy_wstunnel
43
+ RUN chown -R www-data:www-data /var/www/html
44
+
45
+ # --------------------------
46
+ # Supervisor config
47
+ # --------------------------
48
+ RUN mkdir -p /etc/supervisor/conf.d
49
+
50
+ # Apache service
51
+ RUN bash -c 'cat > /etc/supervisor/conf.d/apache.conf <<EOF
52
+ [program:apache2]
53
+ command=/usr/sbin/apachectl -D FOREGROUND
54
+ autostart=true
55
+ autorestart=true
56
+ EOF'
57
+
58
+ # Collabora service
59
+ RUN bash -c 'cat > /etc/supervisor/conf.d/collabora.conf <<EOF
60
+ [program:collabora]
61
+ command=/usr/bin/loolwsd --o:sys_template_path=/opt/lool/systemplate --o:child_root_path=/opt/lool/child-roots --o:storage.filesystem[@allow]=true
62
+ autostart=true
63
+ autorestart=true
64
+ EOF'
65
+
66
+ # MariaDB service
67
+ RUN bash -c 'cat > /etc/supervisor/conf.d/mariadb.conf <<EOF
68
+ [program:mariadb]
69
+ command=/usr/sbin/mysqld
70
+ autostart=true
71
+ autorestart=true
72
+ EOF'
73
+
74
+ # --------------------------
75
+ # Expose ports
76
+ # --------------------------
77
+ EXPOSE 80 9980
78
+
79
+ # --------------------------
80
+ # Launch supervisor
81
+ # --------------------------
82
+ CMD ["/usr/bin/supervisord", "-n"]