-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile-dev.dockerfile
80 lines (66 loc) · 1.84 KB
/
Dockerfile-dev.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
76
77
78
79
80
FROM alpine:3
WORKDIR /var/www
RUN apk add --no-cache \
curl \
nginx \
php8 \
php8-bcmath \
php8-common\
php8-ctype \
php8-curl \
php8-dom \
php8-fileinfo \
php8-fpm \
php8-gd \
php8-iconv \
php8-imap \
php8-intl \
php8-ldap \
php8-mbstring \
php8-mysqli \
php8-opcache \
php8-openssl \
php8-pdo \
php8-pdo_mysql \
php8-pdo_pgsql\
php8-phar \
php8-pgsql \
php8-redis \
php8-session \
php8-simplexml \
php8-sqlite3 \
php8-sodium \
php8-xml \
php8-xmlreader \
php8-xmlwriter \
php8-tokenizer \
php8-zip \
php8-zlib \
supervisor\
php8-xdebug
#Symlink php
#RUN ln -s /usr/bin/php8 /usr/bin/php
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Configure nginx
COPY _devops/local/docker/nginx/nginx-dev.conf /etc/nginx/nginx.conf
# Configure PHP-FPM
COPY _devops/local/docker/php/fpm-pool-dev.conf /etc/php8/php-fpm.d/www.conf
COPY _devops/local/docker/php/php-dev.ini /etc/php8/conf.d/custom.ini
# Configure supervisord
COPY _devops/local/docker/supervisord/supervisord-dev.conf /etc/supervisor/conf.d/supervisord.conf
# Add group
RUN addgroup -g 1000 application
# Add user
RUN adduser -u 1000 -D -G application -s /bin/bash application
# Changing owner on working dir
# Make sure files/folders needed by the processes are accessable when they run under the application user
RUN chown -R application.application /var/www /var/log /run /var/lib/nginx /var/log/nginx
# Switch to use a non-root user from here on
USER application
# Add application
COPY --chown=application . /var/www/
# Expose the port nginx is reachable on
EXPOSE 80
# Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]