-
Notifications
You must be signed in to change notification settings - Fork 47
/
apache.dockerfile
34 lines (27 loc) · 1.31 KB
/
apache.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
30
31
32
33
34
# Multi-stage build, see https://docs.docker.com/develop/develop-images/multistage-build/
FROM alpine AS builder
ENV VERSION 0.10.1
ADD https://github.com/sabre-io/Baikal/releases/download/$VERSION/baikal-$VERSION.zip .
RUN apk add unzip && unzip -q baikal-$VERSION.zip
# Final Docker image
FROM php:8.1-apache
# Install Baikal and required dependencies
COPY --from=builder --chown=www-data:www-data baikal /var/www/baikal
RUN apt-get update &&\
apt-get install -y \
libcurl4-openssl-dev \
msmtp msmtp-mta &&\
rm -rf /var/lib/apt/lists/* &&\
docker-php-ext-install curl pdo pdo_mysql
# Configure Apache + HTTPS
COPY files/apache.conf /etc/apache2/sites-enabled/000-default.conf
RUN a2enmod rewrite ssl && openssl req -x509 -newkey rsa:2048 -subj "/C= " -keyout /etc/ssl/private/baikal.private.pem -out /etc/ssl/private/baikal.public.pem -days 3650 -nodes
RUN sed 's/expose_php = On/expose_php = Off/g' /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini
# Expose HTTPS & data directory
EXPOSE 443
VOLUME /var/www/baikal/config
VOLUME /var/www/baikal/Specific
COPY files/docker-entrypoint.sh /docker-entrypoint.sh
COPY files/docker-entrypoint.d/*.sh files/docker-entrypoint.d/httpd/ /docker-entrypoint.d/
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "apache2-foreground" ]