-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (40 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
53 lines (40 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
45
46
47
48
49
50
51
52
53
#################
## Build image
##
FROM alpine:3.23 AS build
RUN apk add --no-cache composer
WORKDIR /app
RUN mkdir config public src vendor
COPY config ./config/
COPY public ./public/
COPY scripts ./scripts/
COPY src ./src/
COPY \
composer.json \
composer.lock \
mesamatrixctl \
./
RUN rm -f ./public/features.xml
RUN composer install --no-dev
#################
## Final image
##
FROM php:8.5-apache
RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Uncomment if in development environment:
# RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
# RUN rm /var/log/apache2/*
# Point Apache to the public/ directory
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Copy Mesamatrix into /var/www/html/
COPY --from=build /app/ /var/www/html/
# Create private directory and make it www-data:www-data so that the PHP
# scripts can write in it.
RUN mkdir /var/www/html/private && \
chown www-data:www-data /var/www/html/private/