-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (22 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM php:7.4-apache as builder
RUN apt-get update && apt-get install -y git ssl-cert \
&& git clone 'https://github.com/SimplyEdit/simplyedit-backend.git' /app/simplyedit-backend \
&& git clone 'https://github.com/SimplyEdit/simplycode.git' /app/simplycode
FROM php:7.4-apache
COPY --from=builder /app/simplycode/lib /var/www/lib
COPY --from=builder /app/simplycode/www/api/.htaccess /var/www/html/api/.htaccess
COPY --from=builder /app/simplycode/www/api/data/generated.html /var/www/html/simplycode/index.html
COPY --from=builder /app/simplycode/www/api/index.php /var/www/html/api/index.php
COPY --from=builder /app/simplycode/www/css /var/www/html/simplycode/css
COPY --from=builder /app/simplycode/www/js /var/www/html/simplycode/js
COPY --from=builder /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/certs/ssl-cert-snakeoil.pem
COPY --from=builder /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/ssl-cert-snakeoil.key
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
COPY entrypoint.sh /entrypoint.sh
COPY 403.php /var/www/html/403.php
RUN a2enmod --quiet rewrite ssl headers \
&& chmod +x /entrypoint.sh \
&& ln -s /var/www/html/simplycode/js/ /var/www/html/js \
&& ln -s /var/www/www/api/data/generated.html /var/www/html/index.html \
&& mkdir /var/www/html/data && echo '{}' > /var/www/html/data/data.json
ENTRYPOINT ["/entrypoint.sh"]