-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (26 loc) · 866 Bytes
/
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
FROM php:8.2-fpm
SHELL ["/bin/bash", "-c"]
RUN chmod 1777 /tmp
RUN apt-get update -y && apt-get install -y procps
#add user and group
RUN groupadd -f www-data && \
(id -u www-data &> /dev/null || useradd -G www-data www-data -D)
#assign the created user same UID AND GUID OF the host for the mounted dir owner
ARG UID
ARG GID
RUN usermod -u $UID www-data
RUN groupmod -g $GID www-data
EXPOSE 9000
# PID directory
RUN install -d -m 0755 -o www-data -g www-data /run/php-fpm
#custom fpm configs
COPY ./configurations/ /usr/local/etc/
#fpm logs
RUN install -d -o www-data -g www-data /var/log/php && \
install -o www-data -g www-data /dev/null /var/log/php/php-fpm.log
#clean dirs
RUN apt-get clean && \
rm -rf var/lib/apt/lists/* /tmp/* /var/tmp/*
USER www-data
#Define mountable directories -- for developement.
VOLUME ["/var/log/php"]