Skip to content

Commit e0edea1

Browse files
committed
Change Dockerfile to use SimplyCode Electron and local files as source.
1 parent 43b96b7 commit e0edea1

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

Dockerfile

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
FROM php:7.4-apache as builder
1+
FROM node:22.12-alpine AS builder
22

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
58

69
FROM php:7.4-apache
710

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/
2215

2316
RUN a2enmod --quiet rewrite ssl headers \
24-
&& chmod +x /entrypoint.sh \
2517
&& ln -s /var/www/html/simplycode/js/ /var/www/html/js \
2618
&& 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 \
2825

2926
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)