|
1 | | -FROM php:7.4-apache as builder |
| 1 | +FROM node:22.12-alpine AS builder |
2 | 2 |
|
3 | | -RUN apt-get update && apt-get install -y git ssl-cert \ |
4 | | - && git clone 'https://github.com/SimplyEdit/simplycode.git' /app/simplycode |
| 3 | +RUN apk add --no-cache bash git \ |
| 4 | + && mkdir /app \ |
| 5 | + && git -C /app/ clone 'https://github.com/SimplyEdit/simplycode-electron.git' \ |
| 6 | + && git -C /app/ clone 'https://github.com/SimplyEdit/simplyedit-backend.git' \ |
| 7 | + && npm --prefix /app/simplycode-electron install |
5 | 8 |
|
6 | 9 | FROM php:7.4-apache |
7 | 10 |
|
8 | | -COPY --from=builder /app/simplycode/lib /var/www/lib |
9 | | -COPY --from=builder /app/simplycode/www/api/.htaccess /var/www/html/api/.htaccess |
10 | | -COPY --from=builder /app/simplycode/www/api/data/generated.html /var/www/html/simplycode/index.html |
11 | | -COPY --from=builder /app/simplycode/www/api/index.php /var/www/html/api/index.php |
12 | | -COPY --from=builder /app/simplycode/www/css /var/www/html/simplycode/css |
13 | | -COPY --from=builder /app/simplycode/www/js /var/www/html/simplycode/js |
14 | | -COPY --from=builder /app/simplycode/www/simply /var/www/html/simplycode/simply |
15 | | - |
16 | | -COPY --from=builder /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/certs/ssl-cert-snakeoil.pem |
17 | | -COPY --from=builder /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/ssl-cert-snakeoil.key |
18 | | - |
19 | | -COPY 000-default.conf /etc/apache2/sites-available/000-default.conf |
20 | | -COPY entrypoint.sh /entrypoint.sh |
21 | | -COPY 403.php /var/www/html/403.php |
| 11 | +COPY lib/ /var/www/lib/ |
| 12 | +COPY html/ /var/www/html/ |
| 13 | +COPY --from=builder /app/simplycode-electron/simplycode/ /var/www/html/simplycode/ |
| 14 | +COPY --from=builder /app/simplyedit-backend/www/ /var/www/www/ |
22 | 15 |
|
23 | 16 | RUN a2enmod --quiet rewrite ssl headers \ |
24 | | - && chmod +x /entrypoint.sh \ |
25 | 17 | && ln -s /var/www/html/simplycode/js/ /var/www/html/js \ |
26 | 18 | && ln -s /var/www/www/api/data/generated.html /var/www/html/index.html \ |
27 | | - && mkdir /var/www/html/data && echo '{}' > /var/www/html/data/data.json |
| 19 | + && ln -s /var/www/www/api/data/generated.html /var/www/html/index.js \ |
| 20 | + && mv /var/www/lib/000-default.conf /etc/apache2/sites-available/000-default.conf \ |
| 21 | + && mv /var/www/lib/403.php /var/www/html/403.php \ |
| 22 | + && mv /var/www/lib/server.key /etc/ssl/private/ssl-cert-snakeoil.key \ |
| 23 | + && mv /var/www/lib/server.pem /etc/ssl/certs/ssl-cert-snakeoil.pem \ |
| 24 | + && chmod +x /entrypoint.sh \ |
28 | 25 |
|
29 | 26 | ENTRYPOINT ["/entrypoint.sh"] |
0 commit comments