-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
75 lines (54 loc) · 1.24 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
##
# base
##
FROM php:8.3-fpm-alpine AS base
ARG HOME="/var/www"
ARG USER
ARG UID
RUN apk add \
bash \
wget \
unzip \
$PHPIZE_DEPS
RUN docker-php-ext-install -j$(nproc) \
pdo_mysql \
&& pecl install apcu \
&& docker-php-ext-enable pdo_mysql apcu \
&& docker-php-source delete
RUN wget https://getcomposer.org/download/latest-stable/composer.phar -O /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer
RUN adduser -u $UID -h $HOME -H -D -s /usr/sbin/nologin $USER
WORKDIR $HOME
##
# dev php
##
FROM base AS dev
ARG XDEBUG_INI="/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
USER root:root
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
RUN apk add \
linux-headers \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo 'xdebug.mode=debug' >> $XDEBUG_INI \
&& echo 'xdebug.client_host=host.docker.internal' >> $XDEBUG_INI \
&& docker-php-source delete
USER $USER:$USER
EXPOSE 9000
##
# prod php
##
FROM base AS prod
ENV APP_ENV=prod
USER root:root
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
USER $USER:$USER
EXPOSE 9000
##
# nginx
##
FROM nginx:stable-alpine AS nginx
##
# db
##
FROM linuxserver/mariadb:10.11.6 AS db