-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (31 loc) · 1.22 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
30
31
32
33
34
35
36
37
38
39
40
41
# last update 2022-02-01
FROM php:8.1-apache
# enable apache mod_rewrite
RUN a2enmod rewrite ssl expires
# install system dependencies
RUN apt-get update \
&& apt-get install -y libzip-dev git wget --no-install-recommends \
&& apt-get install -y openssl --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# create self-signed certificate for https
RUN mkdir -p /etc/apache2/ssl \
&& openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj \
"/C=DE/ST=Hesse/L=Frankfurt/O=machinateur/OU=private/CN=machinateur.dev" \
-keyout /etc/apache2/ssl/ssl.key -out /etc/apache2/ssl/ssl.crt
# no extensions needed (for now)
#RUN docker-php-ext-install zip
# download composer latest 2.2.x lts version
RUN wget https://getcomposer.org/download/latest-2.2.x/composer.phar \
&& mv composer.phar /usr/bin/composer \
&& chmod +x /usr/bin/composer
# add apache configuration and the entrypoint script
COPY ./docker/apache.conf /etc/apache2/sites-enabled/000-default.conf
# add the source
COPY ./ /var/www/website/
# set working directory
WORKDIR /var/www/website/
# install dependencies
RUN composer install -n
# get apache to run in foreground
CMD ["apache2-foreground"]