-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.portal
56 lines (40 loc) · 2.18 KB
/
Dockerfile.portal
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
ARG PHP_VERSION
FROM bitnami/php-fpm:${PHP_VERSION} as builder
ENV DEBIAN_FRONTEND noninteractive
COPY . /var/www/html
ENV PATH "/usr/local/node/bin:$PATH"
RUN apt-get update && apt-get install -y git unzip && \
git clone https://github.com/nodenv/node-build.git && \
./node-build/install.sh && \
node-build $(cat /var/www/html/.node-version) /usr/local/node && \
rm /var/www/html/.node-version
WORKDIR /var/www/html
RUN composer install --no-dev && \
npm install && \
npm run prod && \
rm -Rf node_modules
FROM bitnami/php-fpm:${PHP_VERSION}-prod
LABEL maintainer="Davide Porrovecchio <davide.porrovecchio@agid.gov.it>"
RUN apt-get update && apt-get install -y --no-install-recommends supervisor && \
rm -rf /var/lib/apt/lists/*
COPY ./supervisord.conf /etc/supervisord.conf
RUN sed -i -e s#@APP_CODE_PATH_CONTAINER@#/var/www/html#g /etc/supervisord.conf
RUN echo "expose_php = false" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "html_errors = false" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "error_log = /dev/stderr" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "date.timezone = Europe/Rome" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "file_uploads = Off" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "allow_url_fopen = Off" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "session.use_strict_mode = 1" >> /opt/bitnami/php/etc/conf.d/wai.ini && \
echo "error_log = /dev/stderr" >> /opt/bitnami/php/etc/php-fpm.d/10-wai-log.conf && \
echo "user = www-data" >> /opt/bitnami/php/etc/php-fpm.d/99-wai.conf && \
echo "group = www-data" >> /opt/bitnami/php/etc/php-fpm.d/99-wai.conf && \
echo "catch_workers_output = true" >> /opt/bitnami/php/etc/php-fpm.d/99-wai.conf && \
echo "decorate_workers_output = false" >> /opt/bitnami/php/etc/php-fpm.d/99-wai.conf && \
mv /opt/bitnami/php/etc/php-fpm.d/www.conf /opt/bitnami/php/etc/php-fpm.d/50-www.conf
COPY --from=builder --chown=www-data:www-data /var/www/html /var/www/html
WORKDIR /var/www/html
RUN find . -type f -exec chmod 644 {} \; && \
find . -type d -exec chmod 755 {} \;
EXPOSE 9000
CMD [ "php-fpm", "-F", "-y", "/opt/bitnami/php/etc/php-fpm.conf" ]