-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
44 lines (33 loc) · 1.3 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Fetch our dependencies with Composer.
FROM composer:2 AS composer
WORKDIR /src/app
COPY composer.* ./
RUN composer install --no-dev
RUN chmod -R 755 vendor/twbs/bootstrap/dist/ && \
chmod -R 755 vendor/components/jquery/
# Reconfigure Apache to work with our application.
FROM alpine:3 AS apache-config
RUN apk update && apk add \
php81-apache2 \
curl \
php81-mbstring \
sed \
&& rm -rf /var/cache/apk/*
RUN sed -zie 's|\(<Directory "/var/www/localhost/htdocs">\)\(.*\)\(</Directory>\)|\1\nOptions Indexes FollowSymLinks\nAllowOverride All\nRequire all granted\n\3|g' /etc/apache2/httpd.conf && \
sed -ie 's|/var/www/localhost/htdocs|/var/www/app/public|g' /etc/apache2/httpd.conf && \
sed -ie 's|#\(LoadModule rewrite_module modules/mod_rewrite.so\)|\1|g' /etc/apache2/httpd.conf
# Setup our application.
FROM alpine:3
RUN apk update && apk add \
php81-apache2 \
curl \
php81-mbstring \
&& rm -rf /var/cache/apk/*
COPY --from=apache-config /etc/apache2/httpd.conf /etc/apache2/httpd.conf
WORKDIR /var/www/app
COPY --from=composer /src/app/vendor ./vendor
COPY --from=composer /src/app/vendor/twbs/bootstrap/dist/ ./themes/bootstrap/lib/bootstrap/
COPY --from=composer /src/app/vendor/components/jquery/ ./themes/bootstrap/lib/jquery/
COPY . ./
EXPOSE 80
ENTRYPOINT ["/usr/sbin/httpd", "-D", "FOREGROUND"]