forked from wbstack/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (35 loc) · 1.54 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
42
43
44
45
46
47
48
FROM composer:2.3 as composer
COPY ./composer.json /tmp/src1/composer.json
COPY ./composer.lock /tmp/src1/composer.lock
WORKDIR /tmp/src1
RUN composer install --no-dev --no-progress --no-autoloader --ignore-platform-req=ext-pcntl
COPY ./ /tmp/src2
RUN cp -r /tmp/src1/vendor /tmp/src2/vendor
WORKDIR /tmp/src2
RUN composer install --no-dev --no-progress --optimize-autoloader --ignore-platform-req=ext-pcntl
FROM php:8.2-apache
RUN apt-get update \
# Needed for the imagick php extension install
&& apt-get install -y --no-install-recommends libmagickwand-dev libpq-dev \
&& echo "" | pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-configure pcntl --enable-pcntl \
&& docker-php-ext-install pcntl \
&& docker-php-ext-enable pcntl \
# Obviously needed for mysql connection
&& docker-php-ext-install pdo pdo_mysql \
# For rewrite rules
&& a2enmod rewrite \
# Needed for gluedev/laravel-stackdriver
&& pecl install opencensus-alpha \
&& docker-php-ext-enable opencensus \
&& rm -rf /var/lib/apt/lists/*
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
# Change the document root
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
COPY --chown=www-data:www-data --from=composer /tmp/src2 /var/www/html
WORKDIR /var/www/html
COPY ./start.sh /usr/local/bin/start
CMD ["/usr/local/bin/start"]
LABEL org.opencontainers.image.source="https://github.com/wbstack/api"